-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #286 from tattle-made/development
chore: merging development to main
- Loading branch information
Showing
25 changed files
with
862 additions
and
120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: Publish Media Worker to Dockerhub for Staging | ||
|
||
permissions: | ||
contents: read | ||
|
||
on: workflow_dispatch | ||
|
||
jobs: | ||
docker: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3.0.0 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@2b51285047da1547ffb1b2203d8be4c0af6b1f20 # v3.2.0 | ||
|
||
- name: Login to Docker Hub | ||
uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20 # v.3.1.0 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Build and push amd64 | ||
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5.3.0 | ||
with: | ||
context: "{{defaultContext}}:src/" | ||
file: worker/media/Dockerfile.media_worker | ||
platforms: linux/amd64 | ||
build-args: | | ||
"UID=1000" | ||
"GID=1000" | ||
push: true | ||
tags: tattletech/feluda-operator-media:worker-amd64-latest | ||
|
||
- name: Build and push arm64 | ||
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5.3.0 | ||
with: | ||
context: "{{defaultContext}}:src/" | ||
file: worker/media/Dockerfile.media_worker_graviton | ||
platforms: linux/arm64 | ||
build-args: | | ||
"UID=1000" | ||
"GID=1000" | ||
push: true | ||
tags: tattletech/feluda-operator-media:worker-arm64-latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import boto3 | ||
import os | ||
|
||
class AWSS3Utils: | ||
aws_access_key_id = os.getenv('AWS_ACCESS_KEY_ID') | ||
aws_secret_access_key = os.getenv('AWS_SECRET_ACCESS_KEY') | ||
aws_region = os.getenv('AWS_REGION') | ||
aws_bucket = os.getenv('AWS_BUCKET') | ||
session = boto3.Session( | ||
aws_access_key_id=aws_access_key_id, | ||
aws_secret_access_key=aws_secret_access_key, | ||
region_name=aws_region | ||
) | ||
s3 = session.client('s3') | ||
|
||
@staticmethod | ||
def download_file_from_s3(bucket_name, file_key, local_file_path): | ||
try: | ||
AWSS3Utils.s3.download_file(bucket_name, file_key, local_file_path) | ||
print(f"File {file_key} downloaded successfully!") | ||
except Exception as e: | ||
print(f"Error downloading file {file_key}: {e}") | ||
raise Exception("Error Downloading file from S3") |
Oops, something went wrong.