Skip to content

Commit

Permalink
Fix #373: allow specification of docker_image_is_local for devbox (#374)
Browse files Browse the repository at this point in the history
Use component module_name (devbox) instead of name (devbox_{user_name}) when trying
to figure out docker_image_is_local.

This assumes all devbox's on a host are either local or not. For now, this assumption
works but it may be we need per user docker_image_is_local configuration in the future.
  • Loading branch information
e-carlin authored Aug 28, 2023
1 parent 1a14565 commit a92c45b
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 8 deletions.
4 changes: 2 additions & 2 deletions rsconf/component/docker_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,9 @@ def _image_args(compt, j2_ctx=None, image=None, image_is_local=None):
if j2_ctx is None:
j2_ctx = compt.j2_ctx
if not image:
image = j2_ctx[compt.name].docker_image
image = j2_ctx[compt.module_name].docker_image
if image_is_local is None:
image_is_local = j2_ctx.pkunchecked_nested_get(
f"{compt.name}.docker_image_is_local",
f"{compt.module_name}.docker_image_is_local",
)
return (j2_ctx, image, bool(image_is_local))
1 change: 1 addition & 0 deletions tests/pkcli/build_data/1.in/db/000.yml
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,7 @@ host:
secondary_setup_f: etc/secondary_setup.sh
devbox:
docker_image: radiasoft/beamsim-jupyter
docker_image_is_local: true
guest_d: /home/vagrant/
package_path:
- sirepo
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@ rsconf_install_access '500' 'vagrant' 'vagrant'
rsconf_install_file '/srv/devbox_devtech3/cmd' 'e4519a71f8e5f1ccf0006350977c367d'
rsconf_install_file '/srv/devbox_devtech3/env' '22e03a134cc868bb12094d8dc118a6c4'
rsconf_install_file '/srv/devbox_devtech3/remove' 'd8d61104199236b9701424db5247cc32'
rsconf_install_file '/srv/devbox_devtech3/start' 'd794df39f3b9c5fa8988a8c7f95d1dff'
rsconf_install_file '/srv/devbox_devtech3/start' 'f05099b7cb37e15f974372a6814d5772'
rsconf_install_file '/srv/devbox_devtech3/stop' '38bd86d43d98dfac2ccce1feca46f21c'
rsconf_install_access '444' 'root' 'root'
rsconf_install_file '/etc/systemd/system/devbox_devtech3.service' 'afdbd1365adaa419c07b302e20dff287'
rsconf_service_docker_pull 'v3.radia.run:5000/radiasoft/beamsim-jupyter:dev' 'devbox_devtech3' 'devbox_devtech3' ''
rsconf_install_access '700' 'vagrant' 'vagrant'
rsconf_install_directory '/srv/devbox_devtech3/jupyter'
rsconf_install_access '700' 'vagrant' 'vagrant'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@ rsconf_install_access '500' 'vagrant' 'vagrant'
rsconf_install_file '/srv/devbox_fullstackdude/cmd' 'cdcf85170cfe88770e11b1fdb2062550'
rsconf_install_file '/srv/devbox_fullstackdude/env' '22e03a134cc868bb12094d8dc118a6c4'
rsconf_install_file '/srv/devbox_fullstackdude/remove' '2e3f05447c3a666355e47923fc17dc79'
rsconf_install_file '/srv/devbox_fullstackdude/start' '8531dfcc84910bb4e094d7fea634a1d8'
rsconf_install_file '/srv/devbox_fullstackdude/start' 'c3e2ce8f63d5e03a5c3c2e972ccd0f3e'
rsconf_install_file '/srv/devbox_fullstackdude/stop' 'b9d49c0e7995043a88d9602b0cf6e284'
rsconf_install_access '444' 'root' 'root'
rsconf_install_file '/etc/systemd/system/devbox_fullstackdude.service' 'e8e49c2404fb1c49825f03be1ab333fe'
rsconf_service_docker_pull 'v3.radia.run:5000/radiasoft/beamsim-jupyter:dev' 'devbox_fullstackdude' 'devbox_fullstackdude' ''
rsconf_install_access '700' 'vagrant' 'vagrant'
rsconf_install_directory '/srv/devbox_fullstackdude/jupyter'
rsconf_install_access '700' 'vagrant' 'vagrant'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
set -euo pipefail
# Needed to allow for empty commands (e.g. docker_registry), bash will complain
# if an variable is empty as unbound (set -u above)
image_cmd=( 'v3.radia.run:5000/radiasoft/beamsim-jupyter:dev' )
image_cmd=( 'radiasoft/beamsim-jupyter:dev' )
user=vagrant
if (( $# > 0 )); then
# No name if called on the command line; called from command line so default log driver
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
set -euo pipefail
# Needed to allow for empty commands (e.g. docker_registry), bash will complain
# if an variable is empty as unbound (set -u above)
image_cmd=( 'v3.radia.run:5000/radiasoft/beamsim-jupyter:dev' )
image_cmd=( 'radiasoft/beamsim-jupyter:dev' )
user=vagrant
if (( $# > 0 )); then
# No name if called on the command line; called from command line so default log driver
Expand Down

0 comments on commit a92c45b

Please sign in to comment.