From 78f21e09a285e3a6a3aa258b75c5b476de88929f Mon Sep 17 00:00:00 2001 From: Shane da Silva Date: Mon, 9 Dec 2024 17:37:14 -0800 Subject: [PATCH] Remove remaining Earthly artifacts (#470) --- .earthlyignore | 13 ------ .github/actions/command/action.yml | 58 ------------------------- .github/workflows/perform-action.yml | 65 ---------------------------- Earthfile | 48 -------------------- 4 files changed, 184 deletions(-) delete mode 100644 .earthlyignore delete mode 100644 .github/actions/command/action.yml delete mode 100644 .github/workflows/perform-action.yml delete mode 100644 Earthfile diff --git a/.earthlyignore b/.earthlyignore deleted file mode 100644 index 23bb94d3b..000000000 --- a/.earthlyignore +++ /dev/null @@ -1,13 +0,0 @@ -/build -/.db -README* -jest.config.* -node_modules -tests -tmp -.git -.github -.gitignore -.tool-versions -.node-version -.vscode diff --git a/.github/actions/command/action.yml b/.github/actions/command/action.yml deleted file mode 100644 index 0f64ebd4d..000000000 --- a/.github/actions/command/action.yml +++ /dev/null @@ -1,58 +0,0 @@ -name: Hub command -description: Run a command (deploy, plan, etc.) for a particular hub - -inputs: - aws-access-key-id: - required: true - aws-secret-access-key: - required: true - ssh-private-key: - required: true - dockerhub-username: - required: true - dockerhub-password: - required: true - command: - required: true - healthcheck: - required: false - -runs: - using: composite - - steps: - # Allow pushing images to ECR - - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@v4 - with: - aws-access-key-id: ${{ inputs.aws-access-key-id }} - mask-aws-account-id: no - aws-secret-access-key: ${{ inputs.aws-secret-access-key }} - aws-region: 'us-east-1' - - name: Login to AWS ECR - id: login-ecr - uses: aws-actions/amazon-ecr-login@v2 - - # For pulling images from Docker Hub without hitting rate limits - - run: docker login --username ${{ inputs.dockerhub-username }} --password ${{ inputs.dockerhub-password }} - shell: bash - - - uses: webfactory/ssh-agent@v0.9.0 - with: - ssh-private-key: ${{ inputs.ssh-private-key }} - - - run: ${{ inputs.command }} - shell: bash - env: - EARTHLY_SECRETS: "AWS_ACCESS_KEY_ID=${{ inputs.aws-access-key-id }},AWS_SECRET_ACCESS_KEY=${{ inputs.aws-secret-access-key }}" - EARTHLY_VERBOSE: true - - - if: ${{ inputs.healthcheck }} - name: Check health - uses: nick-fields/retry@v3 - with: - max_attempts: 30 - timeout_minutes: 2 - shell: bash - command: ${{ inputs.healthcheck }} - warning_on_retry: false diff --git a/.github/workflows/perform-action.yml b/.github/workflows/perform-action.yml deleted file mode 100644 index 33ff08d64..000000000 --- a/.github/workflows/perform-action.yml +++ /dev/null @@ -1,65 +0,0 @@ -name: Perform Action -run-name: ${{ inputs.action }} by @${{ github.actor }} - -on: - workflow_call: - secrets: - TERRAFORM_AWS_ACCESS_KEY_ID: - required: false # Not needed for image builds - TERRAFORM_AWS_SECRET_ACCESS_KEY: - required: false # Not needed for image builds - STACK_DEPLOY_SSH_PRIVATE_KEY: - required: true - FARCASTERXYZ_DOCKER_HUB_USER: - required: true - FARCASTERXYZ_DOCKER_HUB_TOKEN: - required: true - inputs: - action: - description: Action to perform - required: true - type: string - - workflow_dispatch: - inputs: - action: - description: Action to perform - required: true - type: choice - options: - - build - - plan - - deploy - -jobs: - action: - runs-on: [earthly-satellite#runner1] - name: ${{ inputs.action }} - steps: - - name: Clone repo - uses: actions/checkout@v4 - - - name: Set release ID - id: set-release - run: | - release=$(date -u +"%Y-%m-%dT%H-%M-%S-%3NZ") - echo "release = $release" - echo "release=$release" >> "$GITHUB_OUTPUT" - - - name: Set commit hash - id: set-commit-hash - run: | - commit_hash=$(git rev-parse HEAD) - echo "commit_hash = $commit_hash" - echo "commit_hash=$commit_hash" >> "$GITHUB_OUTPUT" - - - name: Execute ${{ inputs.action }} - uses: ./.github/actions/command - with: - aws-access-key-id: ${{ secrets.TERRAFORM_AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.TERRAFORM_AWS_SECRET_ACCESS_KEY }} - ssh-private-key: ${{ secrets.STACK_DEPLOY_SSH_PRIVATE_KEY }} - dockerhub-username: ${{ secrets.FARCASTERXYZ_DOCKER_HUB_USER }} - dockerhub-password: ${{ secrets.FARCASTERXYZ_DOCKER_HUB_TOKEN }} - command: make ${{ inputs.action }} ref=${{ steps.set-commit-hash.outputs.commit_hash }} release=${{ steps.set-release.outputs.release }} - healthcheck: curl --fail https://fnames.farcaster.xyz/_health diff --git a/Earthfile b/Earthfile deleted file mode 100644 index a18a911da..000000000 --- a/Earthfile +++ /dev/null @@ -1,48 +0,0 @@ -VERSION --run-with-aws 0.8 -PROJECT farcasterxyz/fname-registry -FROM alpine:3.20.3 -WORKDIR /workspace - -ARG --global --required fname_registry_commit_ref -ARG --global docker_registry=526236635984.dkr.ecr.us-east-1.amazonaws.com/farcasterxyz/fname-registry -ARG --global FNAME_REGISTRY_DOCKER_IMAGE=$docker_registry:$fname_registry_commit_ref - -fname-registry-repo: - COPY . . - SAVE ARTIFACT /workspace /workspace - -fname-registry-prod: - FROM DOCKERFILE -f +fname-registry-repo/workspace/Dockerfile +fname-registry-repo/workspace/* - SAVE IMAGE --push $FNAME_REGISTRY_DOCKER_IMAGE - -stack-repo: - ARG stack_repo_git_url=git@github.com:warpcast/stack # Must use SSH since private - ARG stack_repo_commit_ref=main - GIT CLONE --branch $stack_repo_commit_ref $stack_repo_git_url /repo - SAVE ARTIFACT /repo /repo - -workspace: - FROM DOCKERFILE -f +stack-repo/repo/Dockerfile +stack-repo/repo/* - CACHE --sharing locked --persist /usr/src/app/workspace/cdktf.out - COPY +fname-registry-repo/workspace /usr/src/app/workspace - ARG CI - ENV CI=$CI - ENV FNAME_REGISTRY_DOCKER_IMAGE=$FNAME_REGISTRY_DOCKER_IMAGE - # OTEL is enabled by default by Earthly but causes crashes. Disable since we don't use - # See https://github.com/earthly/earthly/issues/4260 - ENV OTEL_METRICS_EXPORTER=none - ENV OTEL_TRACES_EXPORTER=none - -interactive-cmd: - FROM +workspace - ARG args - RUN --interactive --no-cache --ssh \ - --secret AWS_ACCESS_KEY_ID --secret AWS_SECRET_ACCESS_KEY \ - bun cli.js --workdir ./workspace $args - -cmd: - FROM +workspace - ARG args - RUN --no-cache --ssh \ - --secret AWS_ACCESS_KEY_ID --secret AWS_SECRET_ACCESS_KEY \ - bun cli.js --workdir ./workspace $args