Cloud Resource Library (CRL) wraps cloud API client libraries for Terra services. It enforces unified logging and allows central changes to how Terra services use Cloud APIs.
TODO add more about library principles and Cloud Object Wrappers.
Terra manages cloud resources for users. To have confidence in our changes, we need integration test suites that exercises real cloud resource lifecycle operations. The expected use of tests is that tests will fail sometimes. Nevertheless, we still want to (eventually) clean up cloud resources created by tests. Enter CRL cleanup mode.
CRL can be configured to run in an integration test cleanup mode. In this mode, when a cloud resource is about to be created with a Cloud Object Wrapper method, the unique identifier for that cloud resource is persisted to an external database. The resources tracked for cleanup can be later deleted, if they have not already been deleted. See CRL Janitor.
- Java 17
- git-secret
- git config updated via
./minnie-kenny.sh -f
Set executable permissions:
chmod +x gradlew
We use Gradle's dependency locking to ensure that builds use the same transitive dependencies, so they're reproducible. This means that adding or updating a dependency requires telling Gradle to save the change. If you're getting errors that mention "dependency lock state" after changing a dep, you need to do this step.
./gradlew dependencies --write-locks
Build and run unit tests:
./gradlew build test
Integration tests are run against cloud providers. Cloud resources required for integration tests are defined in terraform-ap-modules/crl-test.
To run them locally, you need account credentials. Today, two json files with the google service account credentials
is expected at common/src/testFixtures/resources/integration_service_account-admin.json
.
And common/src/testFixtures/resources/integration_service_account-user.json
Broad employees can get the credentials from Vault with:
./local-dev/render-test-config.sh
Then actually run the tests with:
./gradlew integrationTest
TODO: Make this easier, consider making credentials path configurable.
Automatically fix linting issues:
./gradlew spotlessApply
The current available packages are:
Wraps Google Cloud BigQuery API.
Artifact Repository can be found here.
Wraps Google Billing API.
Artifact Repository can be found here.
Wraps Google Cloud ResourceManager Client API. Targets the Cloud Resource Manager v1 for Projects and Organizations. github. Artifact Repository can be found here.
Wraps Google Cloud AI Notebooks Client API. Artifact Repository can be found here.
Wraps Google Cloud Dataproc Client API. Artifact Repository can be found here.
Wraps Google Service Usage API.
Artifact Repository can be found here.
Wraps Google Cloud Storage API.
Artifact Repository can be found here.
Wraps Azure Compute API. Artifact Repository can be found here.
Wraps Azure Container Instances API. Artifact Repository can be found here.
Wraps Azure Relay API. Artifact Repository can be found here.
Wraps Azure Batch Pool API. Artifact Repository can be found here.
The general schema for how cloud resources are presented in CRL.
Artifact Repository can be found here.