Skip to content

Commit

Permalink
add toggles
Browse files Browse the repository at this point in the history
  • Loading branch information
kpedro88 committed Aug 13, 2024
1 parent 12e6459 commit 28253b2
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
15 changes: 12 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,23 @@ or placed in a file `~/.callhostrc` (automatically detected and sourced by `call
```bash
export CALL_HOST_STATUS=${CALL_HOST_STATUS:=disable}
```
Then to enable it temporarily:
Use the dedicated toggle to enable it for the rest of your session (or until another toggle is called):
```bash
call_host_enable
```
or just enable it for one container invocation:
```bash
CALL_HOST_STATUS=enable cmssw-el7 ...
```
* Instead, if you have this enabled by default and you want to temporarily disable this for a specific container invocation:
* Instead, if you have this enabled by default and want to disable it on the fly:
Use the dedicated toggle to disable it for the rest of your session (or until another toggle is called):
```bash
call_host_disable
```
or just disable it for one container invocation:
```bash
CALL_HOST_STATUS=disable cmssw-el7 ...
````
```

### Caveats

Expand Down
10 changes: 10 additions & 0 deletions call_host.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,16 @@ fi
# ensure the pipe dir is bound
export APPTAINER_BIND=${APPTAINER_BIND}${APPTAINER_BIND:+,}${CALL_HOST_DIR}

# enable/disable toggles
call_host_enable(){
export CALL_HOST_STATUS=enable
}
export -f call_host_enable
call_host_disable(){
export CALL_HOST_STATUS=disable
}
export -f call_host_disable

# concept based on https://stackoverflow.com/questions/32163955/how-to-run-shell-script-on-host-from-docker-container

# execute command sent to host pipe; send output to container pipe; store exit code
Expand Down

0 comments on commit 28253b2

Please sign in to comment.