-
-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathhelp.py
244 lines (165 loc) · 6.7 KB
/
help.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
shell_description = """Shell into a Python session with a client.
# Install python, and shell directly into container
$ shpc install python
$ shpc shell python:3.12-rc
Singularity>
# Shell into a Python client interaction
$ shpc shell
> client
Out[1]: [shpc-client]
# Shell into a client with a different interpreter
$ shpc shell -i python
$ shpc shell -i ipython
$ shpc shell -i bpython"""
config_params = """"Customize a settings.yaml config value on the fly to ADD/SET/REMOVE for a command
# Set a single key to be value
$ shpc -c set:key:value <command> <args>
# Add "/tmp/registry' to the "registry" attribute list
$ shpc -c add:registry:/tmp/registry <command> <args>
# Remove from the list
$ shpc -c rm:registry:/tmp/registry"""
install_description = """Install a registry recipe.
$ Install latest version
$ shpc install python
# Show all versions available in config under "tags"
$ shpc show python
# Install a specific version from that set
$ shpc install python:3.9.5-alpine
"""
listing_description = """List installed modules.
# Show installed modules
$ shpc list
# Search for those with "python" in the name
$ shpc list python
# Show modules names without tags (versions)
$ shpc list --names-only
# Show organized by module, with tags (versions) underneath
$ shpc show --short
"""
inspect_description = """Inspect an installed module image."
# Show modules installed (we will need a version)
$ shpc list
# Inpect python, for all attributes
$ shpc inspect python:3.12-rc
# Inpect python runscript
$ shpc inspect python:3.12-rc --runscript
# Same, but output in json (this works for any of the above commands)
$ shpc inspect python:3.12-rc --json
"""
get_description = """Get an image path for a module
# Get the container path of the installed module python:3.12-rc
$ shpc get python:3.12-rc
# Get the path of the environment file
$ shpc get python:3.12-rc --env-file
"""
add_description = """Add an image to modules manually. This command requires a local registry.
# Add a docker URI to your registry under the same namespace
$ shpc add docker://vanessa/salad:latest
# Add a SIF container to the registry namespace
# After adding, you would edit the container.yaml
$ shpc add salad_latest.sif dinosaur/salad:latest
# Install the newly created container.yaml
$ shpc install dinosaur/salad:latest
"""
check_description = """Check if you have latest installed.
# Check to see if we have the latest tag installed for python
$ shpc check python
"""
view_description = """View control to create, install, and uninstall A view name is always required.
# Create a new view
$ shpc view create <name>
# Delete an existing view
$ shpc view delete <name>
# Get the path to an existing view
$ shpc view get <name>
# List existing views
$ shpc view list <name>
# Install a registry module to a named view
$ shpc view install <name> <module>
# Uninstall a registry module from a view
$ shpc view uninstall <name> <module>
# Open up an editor to edit the config for a view
$ shpc view edit <name>
"""
config_description = """Set or get a config value, edit the config, add or remove a list variable, or create a user-specific config.
# Set a key in settings.yml to "value"
$ shpc config set key value
$ shpc config set key:subkey value
# Get the currently set value for "key"
$ shpc config get key
# Open the settings.yml to manually edit
$ shpc config edit
# Create a user-space config in ~/.singularity-hpc/settings.yml
$ shpc config inituser
# Add "/tmp/registry" to the list "registry"
$ shpc config add registry /tmp/registry
# Remove the entry from the list
$ shpc config remove registry /tmp/registry
"""
docgen_description = """Generate a markdown document for a container registry entry
# Generate an entry from the default remote shpc-registry
$ shpc docgen python
# Generate an entry from a custom registry URL
$ shpc docgen --registry-url https://github.com/singularityhub/shpc-registry python
# Customize the branch
$ shpc docgen --registry-url https://github.com/singularityhub/shpc-registry --branch main python
"""
pull_description = """Pull a container built with singularityhub/singularity-deploy.
This command is considered deprecated. If you want to use a SIF in GitHub packages, simply
push with oras and define the container URI as oras: ghcr.io/singularityhub/github-ci.
"""
test_description = """Test a registry entry. This is considered a developer command.
# Test the pull, install, and module command for python
# This command requires your module software.
$ shpc test python
# Use a custom test.sh template
$ shpc test python --template ./test.sh
"""
uninstall_description = """Uninstall a module"
# Uninstall a specific python version
$ shpc uninstall python:3.12-rc1
# Uninstall all Python versions
$ shpc uninstall python
# Uninstall all modules
$ shpc uninstall --all
"""
update_description = """Update a container recipe with new versions. The actual update is supported only for local registries.
# Look for updates for a remote container
$ shpc update quay.io/biocontainers/samtools --dry-run
# Update a local container recipe
$ shpc update quay.io/biocontainers/samtools
# Update all local container yaml recipes
$ shpc update
"""
sync_description = """Get latest files and containers from an upstream shpc. This is only supported to run against a filesystem (local) registry.
# Make a temporary local filesystem registry
$ mkdir -p ./registry
# Sync the default remote registry to it!
$ shpc sync-registry --registry ./registry
# Ask to update from a specific reference (tag or branch):
$ shpc sync-registry --registry ./registry --tag 0.0.58
# Ask to add just a specific container:
$ shpc sync-registry --registry ./registry quay.io/not-local/container
# Add new containers and completely update container.yaml files.
$ shpc sync-registry --registry ./registry --all
# Always do a dry run first!
$ shpc sync-registry --registry ./registry --dry-run
"""
namespace_description = """Set or unset the install namespace.
# Use the ghcr.io/autamus namespace
shpc namespace use ghcr.io/autamus
# Install ghcr.io/autamus/clingo
$ shpc install clingo
# Unset the namespace when you are done
$ shpc namespace unset
"""
show_description = """Show the config for a registry entry
# Show all modules available for the remote registry (or targeted from your settings.yml config)
$ shpc show
# Show complete list, adding tags or versions
$ shpc show --versions
# Show container.yaml metadata for module "python"
$ shpc show python
# Filter all modules to those with "python"
$ shpc show --filter python
"""