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

[INFOPLAT-1427] Action to deploy Protobuf/AVRO schemas to Confluent Schema Registry #850

Merged
merged 27 commits into from
Feb 4, 2025
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions actions/beholder-pulumi-deploy-schema/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# beholder-pulumi-deploy-schema

> Validates and deploys a Protobuf or AVRO schema to Confluent Schema Registry
62 changes: 62 additions & 0 deletions actions/beholder-pulumi-deploy-schema/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: beholder-pulumi-deploy-schema
description:
"Validates and deploys a Protobuf or AVRO schema to Confluent Schema Registry"

inputs:
pulumi_s3_bucket:
description: "S3 bucket name to use as Pulumi backend"
required: true
aws_account_id:
description: "AWS Account ID"
required: false
default: "654654554896" # this is info platform sandbox. TBD: change to prod account once ready
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this change to prod account or the PR is not yet ready? (because is marked as open and not Draft)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

will change soon, but thanks for flagging.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

update: we'll leave the sandbox account default to start off (since this is just an MVP), and clients may use the prod one if they so wish.

aws_region:
description: "AWS region"
required: false
default: "us-west-2"

runs:
using: "composite"
steps:
- uses: actions/[email protected]

- name: Install Pulumi
shell: bash
run: |
curl -fsSL https://get.pulumi.com | sh
echo "$HOME/.pulumi/bin" >> $GITHUB_PATH

- name: Pulumi Login
shell: bash
run: pulumi login s3://${{ inputs.pulumi_s3_bucket }}
env:
PULUMI_CONFIG_PASSPHRASE: ${{ env.PULUMI_CONFIG_PASSPHRASE }}

- name: Docker login to ECR
shell: bash
run: |
aws ecr get-login-password --region ${{ inputs.aws_region }} \
| docker login --username AWS --password-stdin \
${{ inputs.aws_account_id }}.dkr.ecr.${{ inputs.aws_region }}.amazonaws.com

- name: Pull container image
shell: bash
run: |
docker pull ${{ inputs.aws_account_id }}.dkr.ecr.${{ inputs.aws_region }}.amazonaws.com/atlas-beholder-pulumi:latest

- name: Deploy schema
shell: bash
run: |
docker run \
-e CONFLUENT_CLOUD_API_KEY="${{ env.CONFLUENT_CLOUD_API_KEY }}" \
-e CONFLUENT_CLOUD_API_SECRET="${{ env.CONFLUENT_CLOUD_API_SECRET }}" \
-e SCHEMA_REGISTRY_KEY="${{ env.SCHEMA_REGISTRY_KEY }}" \
-e SCHEMA_REGISTRY_SECRET="${{ env.SCHEMA_REGISTRY_SECRET }}" \
-e PULUMI_CONFIG_PASSPHRASE="${{ env.PULUMI_CONFIG_PASSPHRASE }}" \
${{ inputs.aws_account_id }}.dkr.ecr.${{ inputs.aws_region }}.amazonaws.com/atlas-beholder-pulumi deploy-schemas --preview
env:
CONFLUENT_CLOUD_API_KEY: ${{ env.CONFLUENT_CLOUD_API_KEY }}
CONFLUENT_CLOUD_API_SECRET: ${{ env.CONFLUENT_CLOUD_API_SECRET }}
SCHEMA_REGISTRY_KEY: ${{ env.SCHEMA_REGISTRY_KEY }}
SCHEMA_REGISTRY_SECRET: ${{ env.SCHEMA_REGISTRY_SECRET }}
PULUMI_CONFIG_PASSPHRASE: ${{ env.PULUMI_CONFIG_PASSPHRASE }}
11 changes: 11 additions & 0 deletions actions/beholder-pulumi-deploy-schema/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "beholder-pulumi-deploy-schema",
"version": "0.0.0",
nanchano marked this conversation as resolved.
Show resolved Hide resolved
"description": "",
"private": true,
"scripts": {},
"author": "@smartcontractkit",
"license": "MIT",
"dependencies": {},
"repository": "https://github.com/smartcontractkit/.github"
}
7 changes: 7 additions & 0 deletions actions/beholder-pulumi-deploy-schema/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "beholder-pulumi-deploy-schema",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"projectType": "application",
"sourceRoot": "actions/beholder-pulumi-deploy-schema",
"targets": {}
}
Loading