.. This Software (Dioptra) is being made available as a public service by the .. National Institute of Standards and Technology (NIST), an Agency of the United .. States Department of Commerce. This software was developed in part by employees of .. NIST and in part by NIST contractors. Copyright in portions of this software that .. were developed by NIST contractors has been licensed or assigned to NIST. Pursuant .. to Title 17 United States Code Section 105, works of NIST employees are not .. subject to copyright protection in the United States. However, NIST may hold .. international copyright in software created by its employees and domestic .. copyright (or licensing rights) in portions of software that were assigned or .. licensed to NIST. To the extent that NIST holds copyright in this software, it is .. being made available under the Creative Commons Attribution 4.0 International .. license (CC BY 4.0). The disclaimers of the CC BY 4.0 license apply to all parts .. of the software developed or licensed by NIST. .. .. ACCESS THE FULL CC BY 4.0 LICENSE HERE: .. https://creativecommons.org/licenses/by/4.0/legalcode .. _how-to-running-jobs: Running Jobs ======================== This how-to explains how to run :ref:`Jobs ` in Dioptra. Prerequisites ------------- .. tabs:: .. group-tab:: GUI * :ref:`how-to-prepare-deployment` - A deployment of Dioptra is required. * :ref:`tutorial-setup-dioptra-in-the-gui` - Access Dioptra services in the GUI, create a user, and login. * :ref:`how-to-create-queues` - A queue and a worker on which to run the job are required, and must be associated with the entrypoint being used. * :ref:`how-to-create-entrypoints` - An entrypoint describing the job and the plugins required for those entrypoints are required. * :ref:`how-to-create-experiments` - An experiment containing the entrypoint to be used is needed. .. group-tab:: Python Client * :ref:`how-to-prepare-deployment` - A deployment of Dioptra is required. * :ref:`how-to-set-up-the-python-client` - Connect to the Python Client in a Jupyter Notebook. * :ref:`how-to-create-queues` - A queue and a worker on which to run the job are required. * :ref:`how-to-create-entrypoints` - An entrypoint describing the job and the plugins required for those entrypoints are required. * :ref:`how-to-create-experiments` - An experiment containing the entrypoint to be used is needed. .. _how-to-run-jobs: Job Creation Workflow ------------------------ Follow these steps to create and run a job. You can perform these actions via the Graphical User Interface (GUI) or programmatically using the Python Client. .. rst-class:: header-on-a-card header-steps Step 1: Prepare the experiment, entrypoint, and queue for the job ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. tabs:: .. group-tab:: GUI In the Dioptra GUI, navigate to the **Jobs** tab. Click **Create**. Select an *experiment*, an *entrypoint*, and a *queue* for the job. Enter a *timeout* using a human readable string (e.g. "24h", "30m", "30s"). The default unit for the timeout is seconds (``s``) if not specified, and is based on the `rq `__ package. Alternatively, ``h`` can be used to represent hours, and ``m`` can be used to represent minutes. Note that the job will be stopped after this timeout is reached. Optionally, enter a *description* for the job. .. group-tab:: Python Client Retrieve the IDs for an experiment, entrypoint, and queue for the job using the corresponding client methods. **Experiment client GET method:** .. automethod:: dioptra.client.experiments.ExperimentsCollectionClient.get **Entrypoint client GET method:** .. automethod:: dioptra.client.entrypoints.EntrypointsCollectionClient.get **Queue client GET method:** .. automethod:: dioptra.client.queues.QueuesCollectionClient.get .. rst-class:: header-on-a-card header-steps Step 2: Decide on parameterization for the job ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Entrypoints are parameterizable, and jobs can populate these parameters with values (or rely on defaults defined at entrypoint creation). .. tabs:: .. group-tab:: GUI On the job creation page, under the **Entrypoint Parameters** section, enter values for the parameters or accept the defaults. .. group-tab:: Python Client The parameter values are provided as a dictionary during job creation (step 4). .. rst-class:: header-on-a-card header-steps Step 3: Select any needed artifacts for the job ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Entrypoints may also require artifact parameters. Artifacts can be generated by other jobs, and the output type must match the type required by the entrypoint for that artifact input. .. tabs:: .. group-tab:: GUI On the job creation page, under the **Artifact Parameters** section, select the artifact to be used for each artifact input. You can use the clock shaped button to select a specific artifact snapshot. .. group-tab:: Python Client **Client Method:** Use the client to retrieve the IDs of artifacts. .. automethod:: dioptra.client.artifacts.ArtifactsCollectionClient.get .. rst-class:: header-on-a-card header-steps Step 4: Run the job ~~~~~~~~~~~~~~~~~~~ Once all the inputs are prepared, run the job. .. tabs:: .. group-tab:: GUI Click **Submit Job** when all fields and parameter values are set. .. group-tab:: Python Client **Client Method:** Use the client to create the job. .. automethod:: dioptra.client.experiments.ExperimentJobsSubCollectionClient.create .. rst-class:: fancy-header header-seealso See Also --------- * :ref:`Experiments and Jobs Explanation ` - Explanation of the purpose of experiments and jobs and how they relate to each other. * :ref:`Artifacts Explanation ` - Learn about artifacts.