Georgia Tech OMSCS EduTech Class Project
The opsimulate CLI allows students to deploy a working, accessible Gitlab instance and then start a simulation of a production incident with that Gitlab instance that they can investigate, debug, and fix. The opsimulate CLI will have the functionality to create servers, setup the server packages and configuration in a specific way, setup and run a Gitlab service, provide the student with SSH access to the server, and setup an incident from an incident module. The opsimulate CLI tool will also provide hints and a description of and also solution for (if asked for) the incident. It can also check whether the student has successfully resolved the incident.
There are currently no free, open-source simulation-based learning frameworks or tools available for gaining sysadmin/devops related technical operational skills, knowledge, and experience.
- Python 2.x
- a Google Compute Platform Account
pip install opsimulate
Google Compute Platform Setup
- Sign into your GCP account using a Google account at console.cloud.google.com (Gmail works). Please create a Google account if you do not have one.
- At the GCP Home Dashboard, create a project.
- Go the IAM --> Service Accounts page.
- Create a service account. Make sure you select the option to "Furnish a new private key" of the "JSON" Key Type.
Also, make sure you give the service account the Project Owner role.
- Creating the service account will automatically download the service account credentials. It will download as a json file. Note where the credentials json file downloaded to because it will be required when you run
opsimulate load_credentialsto properly copy over the GCP credentials.
opsimulate setupto setup the home
~/.opsimulatedirectory that opsimulate generates artifacts in.
opsimulate load_credentials <path to GCP-service-account-credentials.json>to load in the GCP service account credentials.
opsimulate deployto create the Gitlab instance and make it accessible.
opsimulate statusuntil the output displays that both the VM and Gitlab are up and ready.
- Select a problem module via
opsimulate module_select <path to problem module dir>
- Start the problem simulation via
- In a separate command line window, run
opsimulate connectand run the printed SSH command to connect to your Gitlab server.
- Investigate, debug, fix, do whatever you need to figure out what the issue is and how to fix it.
- If you need help/hints, run
opsimulate module_hintas many times as you need.
- If at any time, you want to check if the problem has been fixed, run
- If you can't fix the issue yourself, run
opsimulate module_resolveto fix the issue and end the problem simulation. Your Gitlab instance will still be up.
- When you're completely done, run
opsimulate cleanto clean up local artifacts (ex. generated SSH keys) and tear down GCP resources like the Gitlab VM.
opsimulate status= Check the status of GCP credentials, selected problem module, VM and Gitlab status
opsimulate setup= Setup the ~/.opsimulate artifacts directory
opsimulate load_credentials= Copy over the GCP service account credentials into ~/.opsimulate directory
opsimulate deploy= Deploy the GCP VM with Gitlab and setup SSH access
opsimulate connect= Print the SSH command that can be used to get onto the Gitlab VM
opsimulate clean= Clean up the GCP Gitlab VM and generated SSH keys
opsimulate module_select= Select a problem module
opsimulate module_start= Start the problem simulation
opsimulate module_hint= Get a hint about the problem
opsimulate module_check= Check if the problem has been resolved
opsimulate module_resolve= Resolve the problem
See the CONTRIBUTING.md
Running/testing opsimulate source:
docker build -t opsimulate-testing -f Dockerfile.testing . docker run -v <absolute path to service account json>:/root/.opsimulate/service-account.json -v <absolute path to module>:/tmp/module -it opsimulate-testing bash
Running opsimulate (from Pypi) in a container:
docker build -t opsimulate . docker run -v <absolute path to service account json>:/root/.opsimulate/service-account.json -v <absolute path to module>:/tmp/module -it opsimulate bash
Pypi Build/Upload Workflow
python setup.py sdist python setup.py sdist upload -r pypitest python setup.py sdist upload -r pypi