diff --git a/prepare-vms/Dockerfile b/prepare-vms/Dockerfile index 949cc0e5..21c0475f 100644 --- a/prepare-vms/Dockerfile +++ b/prepare-vms/Dockerfile @@ -26,7 +26,5 @@ RUN pip install \ WORKDIR $HOME RUN echo "alias ll='ls -lahF'" >> /root/.bashrc -RUN echo "export PATH=$PATH:/root/bin" >> /root/.bashrc -RUN mkdir -p /root/bin -RUN ln -s /root/prepare-vms/scripts/trainer-cli /root/bin/trainer-cli +ENTRYPOINT ["/root/prepare-vms/scripts/trainer-cli"] diff --git a/prepare-vms/README.md b/prepare-vms/README.md index 1b1bc2e8..c0bb41c9 100644 --- a/prepare-vms/README.md +++ b/prepare-vms/README.md @@ -24,10 +24,9 @@ Required environment variables: If you have more than one workshop: - $ cp settings/settings.yaml settings/YOUR_WORKSHOP_NAME-settings.yaml - $ ln -s settings/YOUR_WORKSHOP_NAME-settings.yaml settings.yaml + $ cp settings/default.yaml settings/YOUR_WORKSHOP_NAME-settings.yaml -Update the symlinked `settings.yaml` as needed. This is the file that will be used to generate cards. +Then pass `settings/YOUR_WORKSHOP_NAME-settings.yaml` as an argument to `deploy`, `cards`, etc. ## Usage @@ -41,10 +40,10 @@ Summary of steps to launch a batch of instances for a workshop: * `./trainer start N` (where `N` is the number of AWS instances to create) * `./trainer list` to view the list of tags * `./trainer list TAG` to view the instances with a given `TAG` -* `./trainer deploy TAG` to run `scripts/postprep.rc` via parallel-ssh +* `./trainer deploy TAG settings/somefile.yaml` to run `scripts/postprep.rc` via parallel-ssh * `./trainer pull-images TAG` to pre-pull a bunch of Docker images to the instances * `./trainer test TAG` -* `./trainer cards TAG` to generate a PDF and an HTML file you can print and cut to hand out cards with connection information to attendees +* `./trainer cards TAG settings/somefile.yaml` to generate a PDF and an HTML file you can print and cut to hand out cards with connection information to attendees `./trainer` will run locally if all its dependencies are fulfilled; otherwise it will run in a Docker container. @@ -92,7 +91,7 @@ If you create new VMs, the symlinked file will be overwritten. Instances can be deployed manually using the `deploy` command: - $ ./trainer deploy TAG + $ ./trainer deploy TAG settings/somefile.yaml The `postprep.rc` file will be copied via parallel-ssh to all of the VMs and executed. @@ -102,7 +101,7 @@ The `postprep.rc` file will be copied via parallel-ssh to all of the VMs and exe ### Generate cards - $ ./trainer cards TAG + $ ./trainer cards TAG settings/somefile.yaml ### List tags diff --git a/prepare-vms/scripts/trainer-cli b/prepare-vms/scripts/trainer-cli index f9c953e3..1583f49f 100755 --- a/prepare-vms/scripts/trainer-cli +++ b/prepare-vms/scripts/trainer-cli @@ -54,7 +54,7 @@ deploy_tag(){ echo "Finished deploying $TAG." echo "You may want to run one of the following commands:" echo "./trainer pull-images $TAG" - echo "./trainer cards $TAG settings.yaml" + echo "./trainer cards $TAG " } link_tag() { @@ -89,7 +89,7 @@ pull_tag(){ echo "Finished pulling images for $TAG" echo "You may now want to run:" - echo "./trainer cards $TAG settings.yaml" + echo "./trainer cards $TAG " } wait_until_tag_is_running() { @@ -128,7 +128,7 @@ test_tag(){ ip=$(shuf -n 1 $ips_file) test_vm $ip echo "Tests complete. You may want to run one of the following commands:" - echo "./trainer cards $TAG settings.yaml" + echo "./trainer cards $TAG " } test_vm() { @@ -332,7 +332,7 @@ run_cli() { tag_is_reachable $TAG echo "You may be interested in running one of the following commands:" echo "./trainer ips $TAG" - echo "./trainer deploy $TAG settings.yaml" + echo "./trainer deploy $TAG " ;; opensg) aws ec2 authorize-security-group-ingress \ @@ -425,7 +425,7 @@ run_cli() { echo "$IPS" > tags/$TAG/ips.txt link_tag $TAG echo "To deploy or kill these instances, run one of the following:" - echo "./trainer deploy $TAG settings.yaml" + echo "./trainer deploy $TAG " echo "./trainer list $TAG" ;; status) @@ -464,7 +464,7 @@ run_cli() { ;; *) echo " -./trainer COMMAND [n-instances|tag|settings_file] +./trainer [n-instances|tag] [settings/file.yaml] Core commands: start n Start n instances