Skip to content

Commit

Permalink
improved docstring on create_instance, deleted settings in documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
antbaez9 committed Jul 16, 2024
1 parent 5109735 commit 313bd5d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 19 deletions.
5 changes: 4 additions & 1 deletion distributask/distributask.py
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,10 @@ def create_instance(
offer_id (str): The ID of the offer to create the instance from.
image (str): The image to use for the instance. (example: RaccoonResearch/distributask-test-worker)
module_name (str): The name of the module to run on the instance, configured to be a docker file (example: distributask.example.worker)
command (str): command that initializes celery worker. Has default command if not passed in.
command (str): Command that initializes celery worker. Has default command with specific settings if not passed in. These settings have
been found to be beneficial to the stability and simplicity of a Distributask run.
env_settings (Dict): Used to pass in environment variables to the Vast.ai instance. This is a dictionary with keys of the
environment variable name and values of the desired value of the environment variable.
Returns:
Dict: A dictionary representing the created instance.
Expand Down
18 changes: 0 additions & 18 deletions docs/more_info.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,24 +32,6 @@

#### Visit the [Distributask Class](distributask.md) page for full, detailed documentation of the distributask class.

# Initialized Settings

The Distributask class is initialized with various settings. The ones that depend on the environment are taken from a .env or config.json file present in the parent directory. The following are other settings that deal directory with the Celery app or features for your convience of use:


#### Tasks are acknowledged after they are executed

`celery.app.tasks_acks_late = 1`

#### Worker only fetches one task at a time

`celery.app.worker_prefetch_multiplier = 1`

#### If task creation fails, retry 3 times, waiting 30 seconds between each retry

`celery.app.task.max_retries = 3`
`celery.app.default_retry_delay = 30`

# Docker Setup

Distributask uses a Docker image to transfer the environment and files to the Vast.ai nodes. In your implementation using Distributask, you can use the Docker file in the Distributask repository as a base for your own Docker file. If you choose to do this, be sure to add requirements.txt (and add distributask to the list of packages) to your directory as well so the Docker image has the required packages.
Expand Down

0 comments on commit 313bd5d

Please sign in to comment.