{"id":13821099,"url":"https://github.com/doitintl/iris3","last_synced_at":"2025-05-12T13:15:11.074Z","repository":{"id":43217616,"uuid":"333428300","full_name":"doitintl/iris3","owner":"doitintl","description":"An upgraded and improved version of the Iris automatic GCP-labeling project","archived":false,"fork":false,"pushed_at":"2025-04-30T11:27:31.000Z","size":856,"stargazers_count":71,"open_issues_count":4,"forks_count":26,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-05-12T13:14:53.249Z","etag":null,"topics":["bigquery","cloud-cost","cloud-storage","cloudsql","cost-control","gce","gce-instance","gcp","gcp-projects","gcp-pubsub","google-cloud","google-cloud-platform","google-cloud-pubsub","google-cloud-sql","google-pubsub","labeling","organization-administrator","pubsub","set-labels"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/doitintl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-01-27T13:24:58.000Z","updated_at":"2025-04-30T11:27:35.000Z","dependencies_parsed_at":"2023-02-16T19:00:28.854Z","dependency_job_id":"78a5622d-16a2-47e0-ad1c-5109890b0dca","html_url":"https://github.com/doitintl/iris3","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doitintl%2Firis3","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doitintl%2Firis3/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doitintl%2Firis3/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doitintl%2Firis3/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/doitintl","download_url":"https://codeload.github.com/doitintl/iris3/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253745196,"owners_count":21957319,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bigquery","cloud-cost","cloud-storage","cloudsql","cost-control","gce","gce-instance","gcp","gcp-projects","gcp-pubsub","google-cloud","google-cloud-platform","google-cloud-pubsub","google-cloud-sql","google-pubsub","labeling","organization-administrator","pubsub","set-labels"],"created_at":"2024-08-04T08:01:15.196Z","updated_at":"2025-05-12T13:15:11.016Z","avatar_url":"https://github.com/doitintl.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# Iris\n\nIn Greek mythology, Iris(Ἶρις) is the personification of the rainbow and messenger of the gods. She was the handmaiden to Hera.\n\n![Iris](./iris.jpg \"Iris\") \n# Blog post\n\nSee\nthe [post that presents Iris](https://blog.doit-intl.com/iris-3-automatic-labeling-for-cost-control-7451b480ee13?source=friends_link\u0026sk=b934039e5dc35c9d5e377b6a15fb6381).\n\n# What Iris does for you\n\nIris automatically assigns labels to Google Cloud Platform resources for easier analysis, particularly of cost.\n\nResources of all supported types in all or some of the projects in the GCP organization will get automatically-generated labels with keys like `iris_zone` (the prefix is configurable), and a value copied from the resource. For example, a Google Compute Engine instance would get labels like\n`[iris_name:nginx]`, `[iris_region:us-central1]` and `[iris_zone:us-central1-a]`. This behavior can be configured in various ways; see below.\n\n##  Organization focus\n\nNote that Iris is designed to serve the organization.\n* Iris is designed to label all projects in the organization (though you can filter that down).\n* Iris does not have a project-focused design, where you launch it in a project, and it labels just that project. \n* The organization focus was chosen because labels are used for billing analysis, which is typically done on the organization level. (But this is not mandatory: Projects can be associated arbitrarily with any billing accounts). \n\n## Iris doesn't add new information\n\nIris does not *add* information, only *copy* values that already exist. For example, it can label a VM instance with its zone; but it cannot add a \"business unit\" label because it does not know a resource's business unit. \n\nFor that, you should label all resources when creating them, e.g., in your Terraform scripts. In fact, I recommend doing that (and making Iris extraneous.)\n\n## Labeling existing resources when you deploy Iris\n\nIf you want to label the resources -- virtual machines, PubSub topics etc. -- that *already exist* when you deploy Iris, see section \"[Labeling existing resources](#labeling-existing-resources)\" below.\n\n# Open source\n\nIris is open-source; it is not an official DoiT product. Feel free to send Pull Requests with  new functionality and add new types of labels. See the `TODO.md` file and Github issues for features and fixes you might do.\n\n# When Iris adds labels\n\n## On resource creation\n\nIris labels most types of newly-created resources by listening to Google Cloud Operations Logs. You can disable this: See [INSTALL](INSTALL.md) or run `deploy.sh -h`.  \n\n## On schedule\n\nIris labels a few types of resources periodically on a Cloud Scheduler \"cron\" job. By default, Iris does not label all types of resources  on these cron runs, to save the costs of relabeling -- with the same label -- every day.\n\nYou can have Iris relabel everything on every cron run, See `label_all_on_cron` to `True` in the configuration file.\n\nYou can also disable the scheduled labeling entirely. See Deployment below or run `./deploy.sh -h`\n\n## Labeling existing resources\n\n* When you first use Iris, you may want to label all existing resources. Iris *does not* do this by default.\n* To do this, publish a PubSub message (the content doesn't matter) to `iris_label_all_types_topic`, and a full labeling will be triggered. For example, run with `gcloud pubsub topics publish iris_label_all_types_topic --message=does_not_matter --project $PROJECT_ID` where `$PROJECT_ID` is where Iris is deployed.\n\n# Supported Google Cloud resources\n\nRight now, there are plugins for the following types of resources.\n\nTo learn from the code what resources and keys are added, search for functions whose\nnames start `_gcp_`. The part of the function name after `_gcp_` is used for the label key.\n\n* Compute Engine Instances (Labels name, zone, region, instance type)\n    * Including preemptible instances and instances created by Managed Instance Groups.\n    * Including instances used as GKE Nodes\n* Compute Engine Disks (Labels name, zone, region)\n    * Disks are labeled on creation and on schedule.\n    * But disks created along with an Instance are not labeled on creation. They are labeled with the Cloud Scheduler cron job.\n    * The label indicating whether a disk is attached will change, if the state changed, on the scheduled labeling.\n* Compute Engine Snapshots (Labels name, zone, region)\n* BigQuery Datasets (Labels name, zone, region)\n* BigQuery Tables (Labels name, zone, region)\n* PubSub Subscriptions (Labels name)\n* PubSub Topics (Labels name, zone)\n* CloudSQL (Labels name, zone, region)\n    * These receive a label only with Cloud Scheduler, not on creation.\n* Cloud Storage buckets (Labels name, location)\n* In addition to these, any labels on a project may be copied into the resourcs that are in the project, if you have enabled this in  the\n  configuration file.\n\n \n# Installing\nPlease see [INSTALL](./INSTALL.md).\n# Architecture\nPlease see [ARCHITECTURE](./ARCHITECTURE.md).\n# Development and Testing\nPlease see [HACKING](./HACKING.md).\n ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoitintl%2Firis3","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdoitintl%2Firis3","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoitintl%2Firis3/lists"}