Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Sep 1, 2021. It is now read-only.

Conversation

dberzano
Copy link
Collaborator

@dberzano dberzano commented Jun 18, 2019

  • Wrapper class for handling options
  • Warn if using opts only effective at alidock start
  • Automatically generate config example

Fixes #112 and #73

@dberzano dberzano requested a review from mconcas June 18, 2019 15:31
@dberzano
Copy link
Collaborator Author

@mconcas this should do the trick however let's see if a) tests pass, and b) we come up in the next 18h with some more sensible warning message.

@dberzano dberzano changed the title WIP: Warn if using opts only effective at alidock start Warn if using opts only effective at alidock start Jun 19, 2019
@dberzano
Copy link
Collaborator Author

Example:

$> alidock --cvmfs --image asd
The following options are being ignored:
    --image
    --cvmfs
This is because alidock is already running and they are only valid when a new container is started.
You may want to stop alidock first with:
    alidock stop
and try again. Check `alidock --help` for more information
Starting a shell into the container
[alidock] ~ $>

@dberzano
Copy link
Collaborator Author

...and ready to be reviewed.

@dberzano dberzano changed the title Warn if using opts only effective at alidock start WIP ~ Warn if using opts only effective at alidock start Jun 19, 2019
@dberzano
Copy link
Collaborator Author

Hold on, I may be able to solve #73 as well with a single PR.

@dberzano dberzano changed the title WIP ~ Warn if using opts only effective at alidock start WIP ~ Improve feedback and help on user options Jun 19, 2019
@dberzano
Copy link
Collaborator Author

Perks of the new approach: automatically generate the help with [configOptName] appended, and automatically do the following at the end of the help:

it is possible to specify the most frequently used options in a YAML configuration file in /Users/volpe/.alidock-config.yaml
the following options (along with their default values) can be specified (please include `---` as first line):
---
dockName: alidock                  # same as option --name
updatePeriod: 43200                # same as option --update-period
dontUpdateAlidock: false           # same as option --no-update-alidock
debug: false                       # same as option --debug
imageName: alipier/alidock:latest  # same as option --image
dirOutside: ~/alidock              # same as option --shared
mount: []                          # same as option --mount
dontUpdateImage: false             # same as option --no-update-image
useNvidiaRuntime: false            # same as option --nvidia
enableRocmDevices: false           # same as option --rocm
cvmfs: false                       # same as option --cvmfs
web: false                         # same as option --web

@dberzano dberzano changed the title WIP ~ Improve feedback and help on user options Improve feedback and help on user options Jun 19, 2019
Copy link
Collaborator

@mconcas mconcas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean AF

@mconcas mconcas merged commit 1275df4 into master Jun 19, 2019
@mconcas mconcas deleted the refactor-args branch June 19, 2019 15:12
dberzano pushed a commit that referenced this pull request Jun 19, 2019
* Wrapper class for handling options
* Warn if using opts only effective at alidock start
* Automatically generate config example

Fixes #112 and #73
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Clarify what switches are not effective when container's already running

2 participants