For the main documentation, See README.
- You can deploy Iris in any one project within your Google Cloud organization, but we recommend using a new project just for this.
- The script will deploy Iris (an App Engine service) into this project. That does not mean that Iris is focused on labeling this project. Rather, Iris is always focused on labeling across an organization (though you can filter that to specific projects). See README.
- Here are the required organization-level roles for you, the deployer, to allow the deploy script to set up roles and log sink. (Note that Organization Owner is not enough).
- Organization Role Administrator so the deployment script can create a custom IAM role for Iris that allows it to get and set labels.
- Security Admin so the deployment script can grant the needed role bindings, e.g., to the App Engine service account.
- Logs Configuration Writer so the deployment script can create an organization log sink that sends logs to PubSub.
-
The required project-level roles: Project Owner or Project Editor on the project where Iris is deployed, so that the deployment script can
- create role bindings, topics and subscriptions
- deploy App Engine.
actAs
the serivice accountiris-msg-sender
for deploying it to allow JWT auth.
-
You cannot replace Project Owner or Project Editor with fine-granted "predefined roles" are not possible because deploying Cloud Scheduler cron requires at least Editor or Owner, per GCP docs.
- Get the code with
git clone https://github.com/doitintl/iris3.git
- Have Python 3.9+ as your default
python3
. - Make sure you have these tools
envsubst
jq
- The command-line
pip3
gcloud
. Make sure it is logged-in using an account with the above-mentioned roles.
- Set up the configuration
- Copy
config.yaml.original
toconfig.yaml
. - Optionally configure by editing the config file. (See more documentation below.)
- Copy
- As always with App Engine, a default service must exist before any other exists. So if you are working with a new project:
- Initialize App Engine with
gcloud app create [--region=REGION]
- Deploy a simple "Hello World" default App Engine service. (See
create_project.sh
for an example (not a runnable part of the installation) of creating a project and creating the default App Engine service.)
- Initialize App Engine with
- Now, run
./deploy.sh <PROJECT_ID>
- For documentation on usage of command-line options, run
deploy.sh -h
- For documentation on usage of command-line options, run
- Choosing when the labeling occurs
- By default, labeling occurs on resource-creation, and also using Cloud Scheduler ("cron").
- Each of these works on certain resource types and not others (see the list of supported resources in the main README), depending on configuration (
config.yaml
).
- Each of these works on certain resource types and not others (see the list of supported resources in the main README), depending on configuration (
- Use
-c
switch ondeploy.sh
to label using Cloud Scheduler only. - Use
-e
switch ondeploy.sh
to label on-event only. - If you use both
-c
and-e
or neither, then both types of labeling occur. - To label all resources, including those not configured for being labeled on Cloud Scheduler, see section "Labeling existing resources" in the main README.
- By default, labeling occurs on resource-creation, and also using Cloud Scheduler ("cron").
- Iris' config file is
config.yaml
.- All values are optional.
config.yaml.orig
has detailed documentation of the fields.
- Alternatively, you can have
config-test.yaml
. It takes priority if both it andconfig.yaml
are present. app.yaml
lets you configure App Engine, for example, to set a maximum number of instances. See App Engine documentation.- Editing
cron_full.yaml
lets you optionally change the timing for the Cloud Scheduler scheduled labelings, e.g. to do it more frequently. See Google App Engine documentation.
- Run script
uninstall.sh
- Use
uninstall.sh -h
for help.
Please see ARCHITECTURE.
Please see HACKING.