Skip to content

Commit

Permalink
configure aws creds
Browse files Browse the repository at this point in the history
  • Loading branch information
thorrester committed Nov 13, 2024
1 parent 1098fca commit 6aa7c6d
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 49 deletions.
61 changes: 16 additions & 45 deletions .github/workflows/storage-aws-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,21 @@ permissions:

env:
RUSTFLAGS: -C debuginfo=0 # Do not produce debug symbols to keep memory usage down
CLOUD_BUCKET_NAME: "${{ secrets.CLOUD_BUCKET_NAME }}"
AWS_REGION: "${{ secrets.AWS_REGION }}"

jobs:
rust-lints-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: configure aws credentials
uses: aws-actions/configure-aws-credentials@v3
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
aws-region: ${{ env.AWS_REGION }}

- name: Set up Rust
run: rustup override set stable && rustup update

Expand All @@ -34,7 +42,7 @@ jobs:

- name: Tests
working-directory: ./crates/opsml_storage
run: make test.gcs
run: make test.aws
env:
RUST_BACKTRACE: 1

Expand All @@ -50,14 +58,16 @@ jobs:
python-version: ["3.9", "3.10", "3.11", "3.12"]
runs-on: ${{ matrix.os }}-latest
needs: [rust-lints-test]
env:
GCP_BUCKET_NAME: ${{ secrets.GCP_BUCKET_NAME }}
GOOGLE_ACCOUNT_JSON_BASE64: ${{ secrets.GOOGLE_ACCOUNT_JSON_BASE64 }}
#GCP_PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }}
#WORKLOAD_IDENTITY_PROVIDER: ${{ secrets.WORKLOAD_IDENTITY_PROVIDER }}

steps:
- uses: actions/checkout@v4

- name: configure aws credentials
uses: aws-actions/configure-aws-credentials@v3
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
aws-region: ${{ env.AWS_REGION }}

#- uses: "google-github-actions/auth@v2"
#with:
#project_id: ${{ env.GCP_PROJECT_ID }}
Expand Down Expand Up @@ -96,42 +106,3 @@ jobs:
- name: Run tests and report coverage
working-directory: ./opsml_storage_s3
run: make test.unit

test-build:
needs: [test-os]
name: build - ubuntu - ${{ matrix.manylinux }} - ${{ matrix.target }}
strategy:
fail-fast: false
matrix:
target: [x86_64, x86]
manylinux: [auto]

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: set up python
uses: actions/setup-python@v5
with:
python-version: "3.11"

- run: pip install -U twine 'black>=22.3.0,<23' typing_extensions

- name: build wheels
uses: PyO3/maturin-action@v1

with:
target: ${{ matrix.target }}
manylinux: ${{ matrix.manylinux }}
args: --release --out dist --interpreter 3.11
rust-toolchain: stable
docker-options: -e CI
working-directory: ./opsml_storage_s3

- name: Check dist
working-directory: ./opsml_storage_s3
run: ls -lh dist/

- name: Check wheel
working-directory: ./opsml_storage_s3
run: twine check --strict dist/*
6 changes: 3 additions & 3 deletions crates/opsml_storage/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ format:
lints:
cargo clippy --workspace --all-targets --features "google_storage" -- -D warnings

.PHONY: test
test:
.PHONY: test.gcs
test.gcs:
cargo test --features "google_storage" -- --nocapture --test-threads=1

.PHONY: test.aws
test.aws:
cargo test aws --features "google_storage" -- --nocapture --test-threads=1
cargo test aws --features "aws_storage" -- --nocapture --test-threads=1
2 changes: 1 addition & 1 deletion crates/opsml_storage/src/core/storage/aws.rs
Original file line number Diff line number Diff line change
Expand Up @@ -881,7 +881,7 @@ pub mod aws_storage {
const CHUNK_SIZE: u64 = 1024 * 256;

pub fn get_bucket() -> String {
std::env::var("AWS_BUCKET").unwrap_or_else(|_| "opsml-integration".to_string())
std::env::var("CLOUD_BUCKET_NAME").unwrap_or_else(|_| "opsml-integration".to_string())
}

pub fn create_file(name: &str, chunk_size: &u64) {
Expand Down

0 comments on commit 6aa7c6d

Please sign in to comment.