Closed anzoman closed 4 years ago
cc @cankarm and @dradx just to let you know that things are moving forward here. If you have any new suggestions considering this PR (and our discussion in #46) you can also express them here.
I don't have further comments, LGTM.
@dradX?
The latest CLI options we have are:
# deploy (start from the beginning, warning when already deployed)
opera deploy -i inputs.yaml service.yaml
# resume (start from the point of failure)
opera deploy --resume/-r -i inputs.yaml service.yaml
# clean-state (clean instances folder and start over the deployment)
opera deploy --clean-state/-c -i inputs.yaml service.yaml
# force option skips prompts and warnings
opera deploy -r/-c --force/-f -i inputs.yaml service.yaml
@sstanovnik, can you take a look? :)
The new commands are much clearer as to what they do, yes. A couple of questions:
opera deploy service.yml
, you issue an error, not a warning, right?--resume
, do I still get prompted?I could read the code thoroughly to answer the last two, but I think it's better that this gets discussed as an explicit decision :)
@sstanovnik to answer you questions:
The instance model already exists. Use --resume to continue or --clean-state to delete current deployment state and start over the deployment.
--resume/-r
can be applied and usedGreat, this now looks very much usable. If there are any changes for uses we haven't thought of, let's just decide on that later. :thumbs-up:
The discussion in #46 showed that it would be necessary to add some optional arguments to opera deploy command. In this commit we did just that in order to address the new features which are:
a) Wise men once said that TOSCA orchestrator should treat each deployment separately and distinguish it from all other deployments that have been/would be created before/after. And because opera treats deployments based on file system storage location (i.e. hidden .opera folder) we went on and implemented a different deployment behaviour. So if user tries to deploy again on already deployed instance model an error is raised telling that deployment has already been done.
b) On the other hand users would often like to continue where they left or where their deployment process has been interrupted (for example because of some error in Ansible playbook) and this would then skip all the instances that have been deployed. To realize that we added --resume or -r option where user can continue his orchestration.
c) And lastly DevOps engineers would sometimes prefer to re-run the whole deployment from the starting point without skipping the tasks that were successfully deployed. For that cases --force or -f optional CLI argument was introduced which erases the previous instance model and create a new, fresh one. And to have no worries we ensured that --resume and --force options are mutually exclusive.
The remaining commit messages in this PR are based on #55 which is ready to be merged. This also means that the changes work when using
opera init
command before deploying so that user can doopera deploy {--force|--resume}
.Resolves #46