Skip to content

Commit

Permalink
fix: cos credentials only for settings
Browse files Browse the repository at this point in the history
Problem: the COS container and credentials should be exposed
in the executor settings.
Solution: add them there.

Signed-off-by: vsoch <vsoch@users.noreply.github.com>
  • Loading branch information
vsoch committed Apr 11, 2024
1 parent f31596c commit 3079219
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 29 deletions.
31 changes: 2 additions & 29 deletions docs/further.md
Expand Up @@ -100,6 +100,8 @@ $ snakemake --jobs 1 --executor googlebatch --googlebatch-bucket snakemake-cache
The following environment variables are available within any Google batch run:

- `BATCH_TASK_INDEX`: The index of the workflow step (Google Batch calls a "task")
- `GOOGLEBATCH_DOCKER_PASSWORD`: your docker registry passwork if using the container operating system (COS) and your container requires credentials
- `GOOGLEBATCH_DOCKER_USERNAME`: the same, but the username

### GPU

Expand Down Expand Up @@ -382,35 +384,6 @@ rule hello_world:
"..."
```

#### googlebatch_docker_username

For use with the container operating system (COS) if your container needs credentials to access. Both this field and `googlebatch_docker_password` are required.

```console
rule hello_world:
output:
"...",
resources:
googlebatch_docker_username="monkey"
shell:
"..."
```



#### googlebatch_docker_password

For use with the container operating system (COS) if your container needs credentials to access. Both this field and `googlebatch_docker_username` are required.

```console
rule hello_world:
output:
"...",
resources:
googlebatch_docker_password="monkey"
shell:
"..."
```

#### googlebatch_snippets

Expand Down
27 changes: 27 additions & 0 deletions snakemake_executor_plugin_googlebatch/__init__.py
Expand Up @@ -40,6 +40,33 @@ class ExecutorSettings(ExecutorSettingsBase):
},
)

container: Optional[str] = field(
default=None,
metadata={
"help": "A custom container for use with Google Batch COS",
"env_var": False,
"required": False,
},
)

docker_password: Optional[str] = field(
default=None,
metadata={
"help": "A docker registry password for COS if credentials are required",
"env_var": True,
"required": False,
},
)

docker_username: Optional[str] = field(
default=None,
metadata={
"help": "A docker registry username for COS if credentials are required",
"env_var": True,
"required": False,
},
)

# mpitune configurations are validated on c2 and c2d instances only.
machine_type: Optional[str] = field(
default="c2-standard-4",
Expand Down

0 comments on commit 3079219

Please sign in to comment.