pycodedock | python module that enables to run python scripts

 by   adwait-thattey Python Version: 0.0.3 License: MIT

kandi X-RAY | pycodedock Summary

kandi X-RAY | pycodedock Summary

pycodedock is a Python library. pycodedock has no bugs, it has no vulnerabilities, it has build file available, it has a Permissive License and it has low support. You can install using 'pip install pycodedock' or download it from GitHub, PyPI.

Underneath it makes use of the docker shell utilities. Once the scripts have been loaded into the container, no connection whatsoever is maintained with the host machine. This prevents the script inside from interacting with the host system even if it has administrator privileges inside the container. This module works well with multiple parallel threads(in fact it was designed for that purpose). But you should ensure that all the instances get a unique id (see usage below). The module also allows you to limit the memory or the percentage of CPU that you want to allocate to the script. (See the custom settings part below). However note that if your kernel does not support swap limit capabilities, the script wont be able to 'swap' itself if it runs out of memory and will directly terminate. Also take a look at the warnings section at the end before using the module.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              pycodedock has a low active ecosystem.
              It has 0 star(s) with 0 fork(s). There are no watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              pycodedock has no issues reported. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of pycodedock is 0.0.3

            kandi-Quality Quality

              pycodedock has no bugs reported.

            kandi-Security Security

              pycodedock has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.

            kandi-License License

              pycodedock is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              pycodedock releases are not available. You will need to build from source code and install.
              Deployable package is available in PyPI.
              Build file is available. You can build the component from source.
              Installation instructions, examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of pycodedock
            Get all kandi verified functions for this library.

            pycodedock Key Features

            No Key Features are available at this moment for pycodedock.

            pycodedock Examples and Code Snippets

            No Code Snippets are available at this moment for pycodedock.

            Community Discussions

            No Community Discussions are available at this moment for pycodedock.Refer to stack overflow page for discussions.

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install pycodedock

            Firstly make sure you have docker installed and the current user has the necessary privileges to create and destroy containers. Look here for more info:. You will need a docker image with python support. You can directly pull the pybuntu image $docker pull pybuntu Or if you prefer, create your own image from dockerfile but make sure it has python installed in it. Now you can use the following commands to import pydock and get path to script and input file. The module simply redirects the contents of the input file to STDIN while executing the code. unique_code: string A string identifying the container. If you are running multiple containers parallely, make sure all of them have a different unique_code. code_file : string Absolute path to the file containg script. (variable 'script' in this case). input_file: string Absolute path to the file containing the input that will be redirected to STDIN when executing the script. time_limit: float The time limit in seconds after which the script will be terminated. (defaults to 1000). The module makes use of bash timeout command for this. timeout first sends SIGTERM to the process, then escalates to SIGKILL a few milliseconds later if the process fails to stop. custom_settings: dict : Each container has a set of default settings. You can override those by passing values in this param. Look below in the custom settings section for more details. Note that at this time, container is not running. The following command start the container and execute the code. This may take time to execute depending on your system and the script Once the execution is complete, you can inspect the status. It can mainly have 3 values 0 - Successful execution -1 - Error 124 - Timeout The output and error files are copied to the dir. >>> D.output_file gives the path of the output file. >>> D.error_file gives the path to error file in which error dump is written Now you can perform normal file ops to get the output/error. Once everything is done, it is important to destroy the container and delete residue files >>> D.destroy() This will stop the container and delete all files including the input and output file. So make sure you process them or copy them before calling destroy.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            Install
          • PyPI

            pip install pycodedock

          • CLONE
          • HTTPS

            https://github.com/adwait-thattey/pycodedock.git

          • CLI

            gh repo clone adwait-thattey/pycodedock

          • sshUrl

            git@github.com:adwait-thattey/pycodedock.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link