An awesome python util to handle Harness Lab Users for Instruqt tracks!
Explore the Developer Hub »
View Demo (soon)
·
Report Bug
·
Request Feature
Table of Contents
This is just a simple handler to give us a free slot for taking Harness Certification exams using a Sandbox Account.
This code will then use Terraform to manage the Lab lifecycle, and reset everything to the initial state.
Why? Because we want to re-use the harness sandbox project + lab student user
combo.
This is the current mechanism description:
- It gets the password from Vault
- Then, it picks one free slot from the Harness User Farm (managed by Terraform)
- It will parse everything and give it to Instruqt at runtime, so we can present this to the user doing the exam.
It's best to just export the required env vars and use it as a container.
Nothing for now, since this is used in a particular use case.
Let's use the built container image for now.
The first thing is to add these variables to a file, without any quotation marks on the values:
cat > env.harness << EOL
AIRTABLE_TOKEN=<YOUR_AT_TOKEN>
AIRTABLE_BASE_ID=<YOUR_AT_BASE_ID>
AIRTABLE_TABLE_DB=<YOUR_AT_TABLE_ID>
VAULT_TOKEN=<YOUR_VAULT_TOKEN>
VAULT_SERVER_URL=<YOUR_VAULT_SERVER>
VAULT_SECRET_MOUNTPOINT=<YOUR_VAULT_SERVER_FOR_EXAMPLE_kv-v2>
VAULT_SECRET_PATH=<YOUR_VAULT_SERVER_FOR_EXAMPLE_lab>
EOL
And then you just hit the road:
docker run -it --env-file env.harness gacerioni/instruqt-harness-lab-user-manager:<TAG>
# export all the required environment variables
export AIRTABLE_TOKEN=<YOUR_AT_TOKEN>
export AIRTABLE_BASE_ID=<YOUR_AT_BASE_ID>
export AIRTABLE_TABLE_DB=<YOUR_AT_TABLE_ID>
export VAULT_TOKEN=<YOUR_VAULT_TOKEN>
export VAULT_SERVER_URL=<YOUR_VAULT_SERVER>
export VAULT_SECRET_MOUNTPOINT=<YOUR_VAULT_SERVER_FOR_EXAMPLE_kv-v2>
export VAULT_SECRET_PATH=<YOUR_VAULT_SERVER_FOR_EXAMPLE_lab>
pip install -r requirements
python main.py
For more examples, please refer to the Documentation
- Released first working version @ 05/02/2023
- Adding safeguards everywhere
- Adding a professional-level logger
- Designing full Harness Project and user management
- Multi-language Support
- Portuguese
- Spanish
See the open issues for a full list of proposed features (and known issues).
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE.txt
for more information.
Gabs the Creator - @my_linkedin - gacerioni@gmail.com
Project Link: https://github.com/gacerioni/instruqt-harness-lab-user-manager
Use this space to list resources you find helpful and would like to give credit to. I've included a few of my favorites to kick things off!