Skip to content

Check 1412 create mod digest job - #51

Merged
kyokukou merged 2 commits into
developfrom
CHECK-1412-create-mod-digest-job
Sep 8, 2026
Merged

Check 1412 create mod digest job#51
kyokukou merged 2 commits into
developfrom
CHECK-1412-create-mod-digest-job

Conversation

@kyokukou

@kyokukou kyokukou commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

creates a daily digest for mods (to replace old perl script)

@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown

Terraform plan · development

Plan: 2 to add, 0 to change, 0 to destroy.

Show full plan
google_service_account.job: Refreshing state... [id=projects/arxiv-development/serviceAccounts/mod-notification-handler@arxiv-development.iam.gserviceaccount.com]
google_pubsub_topic.mod_notify: Refreshing state... [id=projects/arxiv-development/topics/mod-notify]
google_pubsub_subscription.mod_actions: Refreshing state... [id=projects/arxiv-development/subscriptions/mod-notification-handler]
google_project_iam_member.job["roles/run.invoker"]: Refreshing state... [id=arxiv-development/roles/run.invoker/serviceAccount:mod-notification-handler@arxiv-development.iam.gserviceaccount.com]
google_project_iam_member.job["roles/pubsub.subscriber"]: Refreshing state... [id=arxiv-development/roles/pubsub.subscriber/serviceAccount:mod-notification-handler@arxiv-development.iam.gserviceaccount.com]
google_project_iam_member.job["roles/cloudsql.client"]: Refreshing state... [id=arxiv-development/roles/cloudsql.client/serviceAccount:mod-notification-handler@arxiv-development.iam.gserviceaccount.com]
google_project_iam_member.job["roles/secretmanager.secretAccessor"]: Refreshing state... [id=arxiv-development/roles/secretmanager.secretAccessor/serviceAccount:mod-notification-handler@arxiv-development.iam.gserviceaccount.com]
google_cloud_run_v2_job.jobs["mod_actions"]: Refreshing state... [id=projects/arxiv-development/locations/us-central1/jobs/mod-notification-handler]
google_cloud_scheduler_job.jobs["mod_actions"]: Refreshing state... [id=projects/arxiv-development/locations/us-central1/jobs/mod-notification-handler-scheduler-trigger]

Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:

  # google_cloud_run_v2_job.jobs["daily_update"] will be created
  + resource "google_cloud_run_v2_job" "jobs" {
      + conditions               = (known after apply)
      + create_time              = (known after apply)
      + creator                  = (known after apply)
      + delete_time              = (known after apply)
      + deletion_policy          = "DELETE"
      + deletion_protection      = true
      + effective_annotations    = (known after apply)
      + effective_labels         = {
          + "arxiv-subsystem"            = "eust-modapi"
          + "arxiv-system"               = "eust"
          + "goog-terraform-provisioned" = "true"
        }
      + etag                     = (known after apply)
      + execution_count          = (known after apply)
      + expire_time              = (known after apply)
      + generation               = (known after apply)
      + id                       = (known after apply)
      + labels                   = {
          + "arxiv-subsystem" = "eust-modapi"
          + "arxiv-system"    = "eust"
        }
      + last_modifier            = (known after apply)
      + latest_created_execution = (known after apply)
      + launch_stage             = (known after apply)
      + location                 = "us-central1"
      + name                     = "mod-daily-digest"
      + observed_generation      = (known after apply)
      + project                  = "arxiv-development"
      + reconciling              = (known after apply)
      + terminal_condition       = (known after apply)
      + terraform_labels         = {
          + "arxiv-subsystem"            = "eust-modapi"
          + "arxiv-system"               = "eust"
          + "goog-terraform-provisioned" = "true"
        }
      + uid                      = (known after apply)
      + update_time              = (known after apply)

      + template {
          + labels      = {
              + "arxiv-subsystem" = "eust-modapi"
              + "arxiv-system"    = "eust"
            }
          + parallelism = 1
          + task_count  = 1

          + template {
              + execution_environment = "EXECUTION_ENVIRONMENT_GEN2"
              + max_retries           = 5
              + service_account       = "mod-notification-handler@arxiv-development.iam.gserviceaccount.com"
              + timeout               = "1200s"

              + containers {
                  + args    = [
                      + "-m",
                      + "app.daily_update.main",
                    ]
                  + command = [
                      + "python",
                    ]
                  + image   = "gcr.io/arxiv-development/mod-notification-handler:0f1e29148e56633155bb2aef286a0e9ad8d3cf37"
                  + name    = "mod-daily-digest-1"

                  + env {
                      + name  = "ARCHIVAL_EMAIL"
                        # (1 unchanged attribute hidden)

                      + value_source {
                          + secret_key_ref {
                              + secret  = "mod-notification-archival-email"
                              + version = "latest"
                            }
                        }
                    }
                  + env {
                      + name  = "CLASSIC_DB_URI"
                        # (1 unchanged attribute hidden)

                      + value_source {
                          + secret_key_ref {
                              + secret  = "modapi-dev-db-uri-for-cloudrun"
                              + version = "latest"
                            }
                        }
                    }
                  + env {
                      + name  = "ENV"
                      + value = "DEVELOP"
                    }
                  + env {
                      + name  = "GCP_PROJECT_ID"
                      + value = "arxiv-development"
                    }
                  + env {
                      + name  = "HALON_CREDS"
                        # (1 unchanged attribute hidden)

                      + value_source {
                          + secret_key_ref {
                              + secret  = "HALON_CREDS"
                              + version = "latest"
                            }
                        }
                    }
                  + env {
                      + name  = "MOD_REPLY_TO"
                        # (1 unchanged attribute hidden)

                      + value_source {
                          + secret_key_ref {
                              + secret  = "mod-notification-mod-reply-to"
                              + version = "latest"
                            }
                        }
                    }
                  + env {
                      + name  = "REDIRECT_EMAILS"
                      + value = "True"
                    }
                  + env {
                      + name  = "REDIRECT_RECIPIENT"
                        # (1 unchanged attribute hidden)

                      + value_source {
                          + secret_key_ref {
                              + secret  = "test-email-group-address"
                              + version = "latest"
                            }
                        }
                    }
                  + env {
                      + name  = "SEND_EMAILS"
                      + value = "True"
                    }

                  + resources {
                      + limits = {
                          + "cpu"    = "1000m"
                          + "memory" = "512Mi"
                        }
                    }

                  + startup_probe (known after apply)

                  + volume_mounts {
                      + mount_path = "/cloudsql"
                      + name       = "cloudsql"
                    }
                }

              + volumes {
                  + name = "cloudsql"

                  + cloud_sql_instance {
                      + instances = [
                          + "arxiv-development:us-east4:arxiv-db-dev",
                        ]
                    }
                }
            }
        }
    }

  # google_cloud_scheduler_job.jobs["daily_update"] will be created
  + resource "google_cloud_scheduler_job" "jobs" {
      + deletion_policy = "DELETE"
      + description     = "Runs the mod-daily-digest Cloud Run job."
      + id              = (known after apply)
      + name            = "mod-daily-digest-scheduler-trigger"
      + paused          = (known after apply)
      + project         = "arxiv-development"
      + region          = "us-central1"
      + schedule        = "20 14 * * 1-5"
      + state           = (known after apply)
      + time_zone       = "America/New_York"

      + http_target {
          + http_method = "POST"
          + uri         = "https://us-central1-run.googleapis.com/apis/run.googleapis.com/v1/namespaces/arxiv-development/jobs/mod-daily-digest:run"

          + oauth_token {
              + scope                 = "https://www.googleapis.com/auth/cloud-platform"
              + service_account_email = "mod-notification-handler@arxiv-development.iam.gserviceaccount.com"
            }
        }

      + retry_config {
          + max_backoff_duration = "3600s"
          + max_doublings        = 5
          + max_retry_duration   = "0s"
          + min_backoff_duration = "5s"
          + retry_count          = (known after apply)
        }
    }

Plan: 2 to add, 0 to change, 0 to destroy.

─────────────────────────────────────────────────────────────────────────────

Note: You didn't use the -out option to save this plan, so Terraform can't
guarantee to take exactly these actions if you run "terraform apply" now.

@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown

Terraform plan · production

No changes. Your infrastructure matches the configuration.

Show full plan
google_service_account.job: Refreshing state... [id=projects/arxiv-production/serviceAccounts/mod-notification-handler@arxiv-production.iam.gserviceaccount.com]
google_pubsub_topic.mod_notify: Refreshing state... [id=projects/arxiv-production/topics/mod-notify]
google_pubsub_subscription.mod_actions: Refreshing state... [id=projects/arxiv-production/subscriptions/mod-notification-handler]
google_project_iam_member.job["roles/secretmanager.secretAccessor"]: Refreshing state... [id=arxiv-production/roles/secretmanager.secretAccessor/serviceAccount:mod-notification-handler@arxiv-production.iam.gserviceaccount.com]
google_project_iam_member.job["roles/cloudsql.client"]: Refreshing state... [id=arxiv-production/roles/cloudsql.client/serviceAccount:mod-notification-handler@arxiv-production.iam.gserviceaccount.com]
google_project_iam_member.job["roles/pubsub.subscriber"]: Refreshing state... [id=arxiv-production/roles/pubsub.subscriber/serviceAccount:mod-notification-handler@arxiv-production.iam.gserviceaccount.com]
google_project_iam_member.job["roles/run.invoker"]: Refreshing state... [id=arxiv-production/roles/run.invoker/serviceAccount:mod-notification-handler@arxiv-production.iam.gserviceaccount.com]
google_cloud_run_v2_job.jobs["mod_actions"]: Refreshing state... [id=projects/arxiv-production/locations/us-central1/jobs/mod-notification-handler]
google_cloud_scheduler_job.jobs["mod_actions"]: Refreshing state... [id=projects/arxiv-production/locations/us-central1/jobs/mod-notification-handler-scheduler-trigger]

No changes. Your infrastructure matches the configuration.

Terraform has compared your real infrastructure against your configuration
and found no differences, so no changes are needed.

@kyokukou
kyokukou requested a review from a team September 4, 2026 17:43
@kyokukou
kyokukou merged commit 83dd947 into develop Sep 8, 2026
4 checks passed
@kyokukou
kyokukou deleted the CHECK-1412-create-mod-digest-job branch September 8, 2026 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants