diff --git a/.github/workflows/deploy-cf-latest-snapshot.yml b/.github/workflows/deploy-cf-latest-snapshot.yml deleted file mode 100644 index 93a0f605a..000000000 --- a/.github/workflows/deploy-cf-latest-snapshot.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: Deploy CF latest-snapshot -on: - pull_request: - paths: - - 'cf/latest-snapshot/**' - - '.github/workflows/deploy-cf-latest-snapshot.yml' - push: - paths: - - 'cf/latest-snapshot/**' - - '.github/workflows/deploy-cf-latest-snapshot.yml' - workflow_dispatch: - -jobs: - check-and-deploy: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Deployment check - uses: cloudflare/wrangler-action@v3 - with: - workingDirectory: "cf/latest-snapshot" - command: deploy --dry-run - - name: Deploy - if: github.ref == 'refs/heads/main' && ( github.event_name == 'push' || github.event_name == 'workflow_dispatch' ) - uses: cloudflare/wrangler-action@v3 - with: - accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} - apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} - workingDirectory: "cf/latest-snapshot" diff --git a/.github/workflows/deploy-cf-prune-latest.yml b/.github/workflows/deploy-cf-prune-latest.yml deleted file mode 100644 index ebd30a495..000000000 --- a/.github/workflows/deploy-cf-prune-latest.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: Deploy CF prune-latest -on: - pull_request: - paths: - - 'cf/prune-latest/**' - - '.github/workflows/deploy-cf-prune-latest.yml' - push: - paths: - - 'cf/prune-latest/**' - - '.github/workflows/deploy-cf-prune-latest.yml' - workflow_dispatch: - -jobs: - check-and-deploy: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Deployment check - uses: cloudflare/wrangler-action@v3 - with: - workingDirectory: "cf/prune-latest" - command: deploy --dry-run - - name: Deploy - if: github.ref == 'refs/heads/main' && ( github.event_name == 'push' || github.event_name == 'workflow_dispatch' ) - uses: cloudflare/wrangler-action@v3 - with: - accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} - apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} - workingDirectory: "cf/prune-latest" diff --git a/.github/workflows/deploy-daily-snapshot.yml b/.github/workflows/deploy-daily-snapshot.yml deleted file mode 100644 index 80979a5a5..000000000 --- a/.github/workflows/deploy-daily-snapshot.yml +++ /dev/null @@ -1,51 +0,0 @@ -name: Snapshot Service -concurrency: ci-${{ github.ref }}-snapshot-service - -on: - pull_request: - branches: - - main - paths: - - 'tf-managed/modules/daily-snapshot/**' - - 'tf-managed/scripts/**' - - 'tf-managed/live/environments/prod/applications/snapshot-service**' - # This needs to be declared explicitly so that the job is actually - # run when moved out of draft. - types: [opened, synchronize, reopened, ready_for_review] - push: - branches: - - main - paths: - - 'tf-managed/modules/daily-snapshot/**' - - 'tf-managed/scripts/**' - - 'tf-managed/live/environments/prod/applications/snapshot-service**' - workflow_dispatch: - -jobs: - deploy-daily-snapshot: - strategy: - matrix: - replica: ["snapshot-service", "snapshot-service-2"] - env: - TF_VAR_monitoring: "{ \"enable\": true,\"slack_enable\":true,\"slack_destination_id\":\"${{ secrets.SLACK_DESTINATION_ID }}\",\"slack_channel_id\":\"${{ secrets.SLACK_CHANNEL_ID }}\"}" - runs-on: ubuntu-latest - permissions: write-all - steps: - - name: Checkout the code - uses: actions/checkout@v4 - - # Using Custom Composite action in ./composite-action/terragrunt folder - - name: Composite Action for Deploying Terragrunt Resources - uses: ./composite-action/terragrunt - with: - do_token: ${{ secrets.DO_TOKEN }} - aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - r2_access_key: ${{ secrets.R2_ACCESS_KEY }} - r2_secret_key: ${{ secrets.R2_SECRET_KEY }} - slack_token: ${{ secrets.SLACK_TOKEN }} - working_directory: tf-managed/live/environments/prod/applications/${{ matrix.replica }} - service_name: ${{ matrix.replica }} - new_relic_account_id: ${{ secrets.NEW_RELIC_ACCOUNT_ID }} - new_relic_api_key: ${{ secrets.NEW_RELIC_API_KEY }} - ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }} diff --git a/.github/workflows/snapshot-service-image.yml b/.github/workflows/snapshot-service-image.yml deleted file mode 100644 index 938ba5adb..000000000 --- a/.github/workflows/snapshot-service-image.yml +++ /dev/null @@ -1,57 +0,0 @@ -name: Snapshot Service Image - -# Cancel workflow if there is a new change to the branch. -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} - -on: - push: - branches: [main] - merge_group: - pull_request: - branches: [main] - -jobs: - build-and-push-docker-image: - name: Build images and push to GHCR - runs-on: ubuntu-latest - timeout-minutes: 30 - steps: - - name: List cached docker images - run: docker image ls - - - name: Checkout code - uses: actions/checkout@v4 - - - name: Login to Github Packages - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - # This step yields the following labels: - # - date+sha, e.g. 2023-01-19-da4692d, - # - latest, - - name: Docker Meta - id: meta - uses: docker/metadata-action@v5 - with: - images: ghcr.io/chainsafe/forest-snapshot-service - tags: | - type=raw,value={{date 'YYYY-MM-DD'}}-{{sha}} - type=raw,value=latest,enable={{is_default_branch}} - - - name: Build image and push to GitHub Container Registry - uses: docker/build-push-action@v6 - with: - context: ./images/snapshot-service/ - build-contexts: | - common=./tf-managed/scripts/ - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - push: ${{ github.ref == 'refs/heads/main' }} - - - name: List docker images - run: docker image ls diff --git a/README.md b/README.md index d33141c7c..adf32044f 100644 --- a/README.md +++ b/README.md @@ -7,3 +7,7 @@ Feel free to contribute to the codebase by resolving any open issues, refactorin ## Questions Feel free to contact the team by creating an issue or raising a discussion [here](https://github.com/ChainSafe/forest/discussions) for more details on interacting with the infrastructure if the need arises during deployment. + +## Past Snapshot Service + +The snapshot service offered by the Forest team was transferred to the ChainSafe's infrastructure team for maintenance and further development. The previous implementation can be found [here](https://github.com/ChainSafe/forest-iac/pull/459). diff --git a/cf/forest-snapshot-listing/README.md b/cf/forest-snapshot-listing/README.md index ad0ad9397..59e5cf789 100644 --- a/cf/forest-snapshot-listing/README.md +++ b/cf/forest-snapshot-listing/README.md @@ -1,6 +1,6 @@ # Snapshot listing worker -This worker acts on endpoints at `https://forest-internal.chainsafe.dev/list**` and will list objects with `diff`, `lite`, and `latest` prefixes. +This worker acts on endpoints at `https://forest-internal.chainsafe.dev/list**` and will list objects with `diff` and `lite` prefixes. # Local deployment diff --git a/cf/forest-snapshot-listing/src/worker.ts b/cf/forest-snapshot-listing/src/worker.ts index 93cfd3a0b..9f29c7afb 100644 --- a/cf/forest-snapshot-listing/src/worker.ts +++ b/cf/forest-snapshot-listing/src/worker.ts @@ -59,10 +59,8 @@ export default {