Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dockerize snapshot upload #400

Merged
merged 4 commits into from
Feb 6, 2024
Merged

dockerize snapshot upload #400

merged 4 commits into from
Feb 6, 2024

Conversation

LesnyRumcajs
Copy link
Member

@LesnyRumcajs LesnyRumcajs commented Jan 30, 2024

Summary of changes
Changes introduced in this pull request:

  • dockerized snapshot service, which can now be run completely locally with only Docker as a requirement

I'll pin the snapshot version in the TF to a specific version once it is built by CI (it needs to reach main first).

Reference issue to close (if applicable)

Part of #364

Other information and links

@LesnyRumcajs LesnyRumcajs force-pushed the dockerize-snapshot-upload branch 6 times, most recently from ee53148 to d2ba038 Compare January 31, 2024 12:01
@LesnyRumcajs LesnyRumcajs marked this pull request as ready for review January 31, 2024 12:01
@LesnyRumcajs LesnyRumcajs requested a review from a team as a code owner January 31, 2024 12:01
@LesnyRumcajs LesnyRumcajs requested review from hanabi1224 and jdjaustin and removed request for a team January 31, 2024 12:01
Copy link

github-actions bot commented Jan 31, 2024

Forest: Snapshot Service Infrastructure Plan: success

Show Plan
data.external.sources_tar: Reading...
data.local_file.init: Reading...
data.local_file.init: Read complete after 0s [id=dc94e3ebf33fe45cb5e8946405ca9f6d06f4f21a]
data.external.sources_tar: Read complete after 0s [id=-]
module.monitoring[0].newrelic_notification_channel.slack-channel[0]: Refreshing state... [id=196b91ab-64b9-41b1-af4c-67661bab1f4a]
module.monitoring[0].newrelic_alert_policy.alert: Refreshing state... [id=1299554]
data.local_file.sources: Reading...
data.local_file.sources: Read complete after 0s [id=bb5129f3e24d23f393420ccd3ea738485eda581b]
data.digitalocean_project.forest_project: Reading...
data.digitalocean_ssh_keys.keys: Reading...
data.digitalocean_ssh_keys.keys: Read complete after 0s [id=ssh_keys/8656000852680004208]
digitalocean_droplet.forest: Refreshing state... [id=399556012]
module.monitoring[0].newrelic_workflow.alerting-workflow-slack[0]: Refreshing state... [id=10f5673a-1c73-418f-a35d-8c83aeee09c1]
module.monitoring[0].newrelic_nrql_alert_condition.disk_space: Refreshing state... [id=1299554:5688846]
digitalocean_firewall.forest-firewall: Refreshing state... [id=e660e0a3-65e5-4348-88c1-45d9b28fba50]
data.digitalocean_project.forest_project: Read complete after 2s [id=da5e6601-7fd9-4d02-951e-390f7feb3411]
digitalocean_project_resources.connect_forest_project: Refreshing state... [id=da5e6601-7fd9-4d02-951e-390f7feb3411]

Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  ~ update in-place
-/+ destroy and then create replacement

Terraform will perform the following actions:

  # digitalocean_droplet.forest must be replaced
-/+ resource "digitalocean_droplet" "forest" {
      ~ created_at           = "2024-02-05T15:18:00Z" -> (known after apply)
      ~ disk                 = 200 -> (known after apply)
      ~ id                   = "399556012" -> (known after apply)
      ~ ipv4_address         = "161.35.64.58" -> (known after apply)
      ~ ipv4_address_private = "10.135.0.5" -> (known after apply)
      + ipv6_address         = (known after apply)
      ~ locked               = false -> (known after apply)
      ~ memory               = 16384 -> (known after apply)
        name                 = "prod-forest-snapshot"
      ~ price_hourly         = 0.125 -> (known after apply)
      ~ price_monthly        = 84 -> (known after apply)
      ~ private_networking   = true -> (known after apply)
      ~ status               = "active" -> (known after apply)
        tags                 = [
            "iac",
            "prod",
        ]
      ~ urn                  = "do:droplet:399556012" -> (known after apply)
      ~ user_data            = (sensitive value) # forces replacement
      ~ vcpus                = 4 -> (known after apply)
      ~ volume_ids           = [] -> (known after apply)
      ~ vpc_uuid             = "46a525ac-fd37-47ea-bb10-95c1db0055f7" -> (known after apply)
        # (9 unchanged attributes hidden)
    }

  # digitalocean_firewall.forest-firewall will be updated in-place
  ~ resource "digitalocean_firewall" "forest-firewall" {
      ~ droplet_ids     = [
          - 399556012,
        ] -> (known after apply)
        id              = "e660e0a3-65e5-4348-88c1-45d9b28fba50"
        name            = "prod-forest-snapshot"
        tags            = []
        # (3 unchanged attributes hidden)

        # (6 unchanged blocks hidden)
    }

  # digitalocean_project_resources.connect_forest_project will be updated in-place
  ~ resource "digitalocean_project_resources" "connect_forest_project" {
        id        = "da5e6601-7fd9-4d02-951e-390f7feb3411"
      ~ resources = [
          - "do:droplet:399556012",
        ] -> (known after apply)
        # (1 unchanged attribute hidden)
    }

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

Changes to Outputs:
  ~ ip = [
      - "161.35.64.58",
      + (known after apply),
    ]

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

Saved the plan to: /home/runner/work/forest-iac/forest-iac/tfplan

To perform exactly these actions, run the following command to apply:
    terraform apply "/home/runner/work/forest-iac/forest-iac/tfplan"

@LesnyRumcajs LesnyRumcajs force-pushed the dockerize-snapshot-upload branch from d2ba038 to 15f51ba Compare January 31, 2024 13:12
@LesnyRumcajs LesnyRumcajs force-pushed the dockerize-snapshot-upload branch from 15f51ba to 5bcb69a Compare January 31, 2024 13:12
@LesnyRumcajs
Copy link
Member Author

@hanabi1224 @jdjaustin

@LesnyRumcajs LesnyRumcajs requested review from a team, sudo-shashank and ruseinov and removed request for a team, jdjaustin and sudo-shashank February 5, 2024 15:48
Copy link
Contributor

@samuelarogbonlo samuelarogbonlo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

- name: Build image and push to GitHub Container Registry
uses: docker/build-push-action@v5
with:
context: ./images/snapshot-service/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
context: ./images/snapshot-service/
context: ./images/snapshot-service/
load: true

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe without load: true, docker image ls steps won't list the output image

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


# TODO: Change this once `sync-check` is fully-dockerized as well.
# hadolint ignore=DL3022
COPY --from=common ruby_common /opt/snapshot-service/ruby_common
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where is common defined?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, it's from build-context. Maybe adding some comments to reduce the confusion

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hanabi1224 done. I had to drop apk packages pinning, sadly, alpine repos don't keep old packages, so there's no way to meaningfully pin the versions.

@LesnyRumcajs LesnyRumcajs force-pushed the dockerize-snapshot-upload branch from 14c293b to a7cb602 Compare February 6, 2024 08:48
@LesnyRumcajs LesnyRumcajs enabled auto-merge (squash) February 6, 2024 08:50
@LesnyRumcajs LesnyRumcajs merged commit 8ce48b2 into main Feb 6, 2024
10 checks passed
@LesnyRumcajs LesnyRumcajs deleted the dockerize-snapshot-upload branch February 6, 2024 08:51
LesnyRumcajs added a commit that referenced this pull request Feb 6, 2024
LesnyRumcajs added a commit that referenced this pull request Feb 9, 2024
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.

3 participants