mirror of
https://github.com/jpetazzo/container.training.git
synced 2026-07-28 01:01:12 +00:00
Replace settings.yaml with <settings/somefile.yaml> in the documentation, as per @jpetazzo request; add entrypoint to Dockerfile; remove symlink and path manipulation from Dockerfile.
This commit is contained in:
@@ -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"]
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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 <settings/somefile.yaml>"
|
||||
}
|
||||
|
||||
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 <settings/somefile.yaml>"
|
||||
}
|
||||
|
||||
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 <settings/somefile.yaml>"
|
||||
}
|
||||
|
||||
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 <settings/somefile.yaml>"
|
||||
;;
|
||||
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 <settings/somefile.yaml>"
|
||||
echo "./trainer list $TAG"
|
||||
;;
|
||||
status)
|
||||
@@ -464,7 +464,7 @@ run_cli() {
|
||||
;;
|
||||
*)
|
||||
echo "
|
||||
./trainer COMMAND [n-instances|tag|settings_file]
|
||||
./trainer <command> [n-instances|tag] [settings/file.yaml]
|
||||
|
||||
Core commands:
|
||||
start n Start n instances
|
||||
|
||||
Reference in New Issue
Block a user