This project provides utilities for testing workflows involving Confidential ACI.
latest=$(gh release list -R microsoft/confidential-aci-testing -L 1 --json tagName --jq '.[0].tagName')
gh release download $latest -R microsoft/confidential-aci-testing
pip install c-aci-testing*.tar.gz
rm c-aci-testing*.tar.gz
All scripts can be given call-time parameters, but for parameters which will be consistent across runs, it's easier to define an environment file to use. You can create a blank env file with:
python -m c_aci_testing.env_create > cacitesting.env
Then just fill in the values you wish to use for your deployments, and source it
source cacitesting.env
python -m c_aci_testing.infra_deploy
This will deploy/check the resources required to build images, generate security policies and deploy container instances.
This will only succeed if you're logged into an Azure account with subscription level permissions to assign roles.
export TARGET_PATH=./my_new_target
export TARGET_NAME=my_new_target
python -m c_aci_testing.target_create $TARGET_PATH -n $TARGET_NAME
This populates the directory with an example target, you can then modify the target for your specific workflow.
python -m c_aci_testing.target_run $TARGET_PATH -n <YOUR_DEPLOYMENT_NAME>
This will:
- Build any images defined in your target directory
- Push them to your configured container registry
- Generate a security policy and update your .bicepparam file
- Deploy the container group to Confidential ACI
- Follow the logs of the deployed container and wait until process exits
- Remove the container group
As well as running a given target end to end, each individual stage of the process can be run separately
python -m c_aci_testing.images_build $TARGET_PATH
python -m c_aci_testing.images_push $TARGET_PATH
python -m c_aci_testing.policies_gen $TARGET_PATH
DEPLOYMENT_NAME=my-deployment
# Deploy and monitor (Can be run separately)
python -m c_aci_testing.aci_monitor --id \
$(python -m c_aci_testing.aci_deploy $TARGET_PATH --name $DEPLOYMENT_NAME)
# Cleanup
python -m c_aci_testing.aci_remove --name $DEPLOYMENT_NAME
python -m c_aci_testing.vscode_run_debug
This adds launch configurations for each script in the python package for easy use.
python -m c_aci_testing.vscode_testing $TARGET_PATH
This creates a Python Unittest runner for a provided target, as well as populating a workspace level settings file which points unittest at the target. If there is already a workspace level target, it is left alone.
Coming Soon
This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.
When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.
This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.