Skip to content

Latest commit

 

History

History
287 lines (208 loc) · 12.3 KB

File metadata and controls

287 lines (208 loc) · 12.3 KB

Contributors Forks Stargazers Issues MIT License LinkedIn


Logo

Instruqt Harness Lab User Manager (Anbu Automation)

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
  1. About The Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Contributing
  6. License
  7. Contact
  8. Acknowledgments

About The Project

Product Name Screen Shot

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.

(back to top)

Built With

  • Harness
  • Python
  • AirTable
  • Vault

(back to top)

Getting Started

It's best to just export the required env vars and use it as a container.

Prerequisites

Nothing for now, since this is used in a particular use case.

Installation

Let's use the built container image for now.

Usage

The easy way (containers)

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>

The hard way (directly in your env)

# 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

(back to top)

Roadmap

  • 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).

(back to top)

Contributing

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!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

License

Distributed under the MIT License. See LICENSE.txt for more information.

(back to top)

Contact

Gabs the Creator - @my_linkedin - gacerioni@gmail.com

Project Link: https://github.com/gacerioni/instruqt-harness-lab-user-manager

(back to top)

Acknowledgments

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!

(back to top)