|
2 | 2 |
|
3 | 3 | from paperspace import client, config |
4 | 4 | from paperspace.cli import common |
| 5 | +from paperspace.cli.cli_types import json_string |
5 | 6 | from paperspace.cli.common import del_if_value_is_none |
6 | 7 | from paperspace.cli.cli import cli |
7 | 8 | from paperspace.commands import jobs as jobs_commands |
@@ -66,25 +67,25 @@ def list_jobs(api_key, **filters): |
66 | 67 |
|
67 | 68 | @jobs_group.command("create", help="Create job") |
68 | 69 | @click.option("--name", "name", help="Job name", required=True) |
69 | | -@click.option('--machineType', 'machineType', help="Virtual machine type") |
70 | | -@click.option('--container', 'container', help="Docker container") |
71 | | -@click.option('--command', 'command', help="Job command/entrypoint") |
72 | | -@click.option('--ports', 'ports', help="Mapped ports") |
73 | | -@click.option('--isPublic', 'isPublic', help="Flag: is job public") |
| 70 | +@click.option("--machineType", "machineType", help="Virtual machine type") |
| 71 | +@click.option("--container", "container", help="Docker container") |
| 72 | +@click.option("--command", "command", help="Job command/entrypoint") |
| 73 | +@click.option("--ports", "ports", help="Mapped ports") |
| 74 | +@click.option("--isPublic", "isPublic", help="Flag: is job public") |
74 | 75 | @click.option("--workspace", "workspace", required=False, help="Path to workspace directory") |
75 | 76 | @click.option("--workspaceArchive", "workspaceArchive", required=False, help="Path to workspace archive") |
76 | 77 | @click.option("--workspaceUrl", "workspaceUrl", required=False, help="Project git repository url") |
77 | 78 | @click.option("--workingDirectory", "workingDirectory", help="Working directory for the experiment", ) |
78 | | -@click.option('--experimentId', 'experimentId', help="Experiment Id") |
79 | | -# @click.option('--envVars', 'envVars', help="Environmental variables ") # TODO |
80 | | -@click.option('--useDockerfile', 'useDockerfile', help="Flag: using Dockerfile") |
81 | | -@click.option('--isPreemptible', 'isPreemptible', help="Flag: isPreemptible") |
82 | | -@click.option('--project', 'project', help="Project name") |
83 | | -@click.option('--projectHandle', '--projectId', 'projectHandle', help="Project handle", required=True) |
84 | | -@click.option('--startedByUserId', 'startedByUserId', help="User ID") |
85 | | -@click.option('--relDockerfilePath', 'relDockerfilePath', help="Relative path to Dockerfile") |
86 | | -@click.option('--registryUsername', 'registryUsername', help="Docker registry username") |
87 | | -@click.option('--registryPassword', 'registryPassword', help="Docker registry password") |
| 79 | +@click.option("--experimentId", "experimentId", help="Experiment Id") |
| 80 | +@click.option("--jobEnv", "envVars", type=json_string, help="Environmental variables ") |
| 81 | +@click.option("--useDockerfile", "useDockerfile", help="Flag: using Dockerfile") |
| 82 | +@click.option("--isPreemptible", "isPreemptible", help="Flag: isPreemptible") |
| 83 | +@click.option("--project", "project", help="Project name") |
| 84 | +@click.option("--projectHandle", "--projectId", "projectHandle", help="Project handle", required=True) |
| 85 | +@click.option("--startedByUserId", "startedByUserId", help="User ID") |
| 86 | +@click.option("--relDockerfilePath", "relDockerfilePath", help="Relative path to Dockerfile") |
| 87 | +@click.option("--registryUsername", "registryUsername", help="Docker registry username") |
| 88 | +@click.option("--registryPassword", "registryPassword", help="Docker registry password") |
88 | 89 | @common.api_key_option |
89 | 90 | def create_job(api_key, **kwargs): |
90 | 91 | del_if_value_is_none(kwargs) |
|
0 commit comments