Child pages
  • Command Line Jumpstart for the GTE
Skip to end of metadata
Go to start of metadata

Introduction 

When connecting to the AWS training environment via SSH, students will be interacting with a Bash shell.  If you are not familiar, the shell is a dollar-sign prompt you can type commands at (e.g. [student@ip ~]$) .  The only commands you really need to know for the Grouper Training Environment (GTE) are listed below.

Essential Docker Commands

The AWS environment is essentially your gateway to interacting with Docker containers that host the services that make up the training environment.  You'll be asked to start or stop containers by issuing commands as the super user.  For the most part, you'll interact with services via your web browser.  Since the services are not available directly on the public Internet, your SSH client will forward requests made to your local computer to the AWS environment you are connected to.  Docker containers you run in that environment will receive those requests and send the results back across your SSH tunnel to your browser.

Check What Docker Containers are Running

What docker containers are running?
[student@ip ~]$ docker ps

Issuing this command will list what docker containers are running in your environment.  Normally, you will have only 1 or 2 containers running-- the GTE container for your current course and possible a container for an external RabbitMQ service that interacts with the GTE for some courses.  This command allows you to see the name of the running containers.

Run a Container

Run a container
[student@ip ~]$ ./gte $COURSE_AND_EXERCISE

The gte command has been added to your shell environment as a shortcut so that the commands you type to start containers are short.  The notation "$COURSE_AND_EXERCISE" above means you should replace that with a course and exercise number.  For example, "./gte 201.1.1" will start the container for course 201.1, exercise 1.

One at a Time, Please

Because all the GTE containers want to use the same network ports, you can only run one at a time and expect the service to work. Remember that if you want to start a new container, you probably need to stop any existing container you have running (recall "docker ps" above). To stop a container, you'll need to use "docker stop $COURSE_AND_EXERCISE".

Stop a Container

Stop a container
[waldbiec@ip]# docker stop $COURSE_AND_EXERCISE

This command will stop a running container.  The symbol "$CONTAINER_ID_OR_NAME" should be replaced with the container ID or the name of the container, both of which can be viewed with the "docker ps" command above.  The "gte" shortcut names your running container with the name of the course and exercise (i.e. the same name you use to start the container with the "gte" command).

Get a Shell Into a Container

Shell Into a Container
[student@ip ~]$ ./gte-shell $COURSE_AND_EXERCISE

This will allow you to get a command shell in a running container.  The symbol "$COURSE_AND_EXERCISE" should be replaced with the container ID or the name of the container, both of which can be viewed with the "docker ps" command above.

Run GSH In a Running Container

Run GSH In a Running Container
[student@ip ~]$ ./gte-gsh $COURSE_AND_EXERCISE

This will allow you to get a Grouper command shell (gsh) in a running container.  The symbol "$COURSE_AND_EXERCISE" should be replaced with the container ID or the name of the container, both of which can be viewed with the "docker ps" command above.

Run the RabbitMQ container

Run rabbitMQ
[student@ip ~]$ docker run -d -p 15672:15672 --env RABBITMQ_NODENAME=docker-rabbit --hostname rabbitmq --name=rabbitmq rabbitmq:management

This starts a RabbitMQ container that will be used in several exercises.

A Note on Container Names

For most courses, 2 docker images exist-- A starting image named COURSE.1, and an image that is in the expected end state called COURSE.end.  E.g. "201.1.1" and "201.1.end". Normally, you are not expected to start and stop containers between exercises.



 



  • No labels