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

S3 in CI #201

Merged
merged 4 commits into from
Jul 31, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
34 changes: 1 addition & 33 deletions .github/workflows/test_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
branches:
- main
pull_request_target:
pull_request:
branches:
- main

Expand Down Expand Up @@ -281,35 +281,3 @@ jobs:

- name: Run stubtest on typed modules
run: stubtest acquire

merge:
name: Automerge
runs-on: "ubuntu-latest"
needs:
- platforms
- dcam
# - egrabber
- spinnaker
- pvcam
- typing
if: ${{ github.actor == 'dependabot[bot]' }}
steps:
- name: Checkout PR
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
repository: ${{ github.event.pull_request.head.repo.full_name }}

- name: Approve PR
run: gh pr review --approve "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GH_TOKEN: ${{ secrets.PAT }}

# Don't auto-merge major version updates
- name: Merge PR
if: ${{ steps.dependabot-metadata.outputs.update-type != 'version-update:semver-major' }}
run: gh pr merge --auto --squash "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GH_TOKEN: ${{ secrets.PAT }}
44 changes: 44 additions & 0 deletions .github/workflows/test_s3.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Test S3

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
s3:
name: Test S3 functionality
runs-on: ubuntu-latest
env:
MINIO_ROOT_USER: admin
MINIO_ROOT_PASSWORD: password
MINIO_URL: http://localhost:9000
MINIO_ALIAS: myminio
MINIO_ACCESS_KEY: acquire
MINIO_SECRET_KEY: 12345678

steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"

- name: Install minio and mcli
run: |
apt update && apt install -y tmux wget
wget https://dl.min.io/server/minio/release/linux-amd64/minio -O /usr/local/bin/minio
wget https://dl.min.io/client/mc/release/linux-amd64/mc -O /usr/local/bin/mcli
chmod +x /usr/local/bin/minio
chmod +x /usr/local/bin/mcli

- name: Start minio in tmux
run: |
tmux new -d -s minio
tmux send-keys -t minio "MINIO_ROOT_USER=$MINIO_ROOT_USER MINIO_ROOT_PASSWORD=$MINIO_ROOT_PASSWORD minio server /tmp/minio --console-address :9001" Enter
sleep 5
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why is it necessary to put the terminal to sleep? Also, how did we decide on 5 seconds?

Copy link
Member Author

@aliddell aliddell Jul 31, 2024

Choose a reason for hiding this comment

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

We can take this part out for now, but we'll need to give the server some time to spin up before we start exercising it.

Edit: my bad, we are exercising the server already. 5 seconds is plenty of time to make sure the server is up before we start working it. We could maybe get away with fewer but if we go much lower we might see variance. We know 5 is good.

mcli alias set $MINIO_ALIAS $MINIO_URL $MINIO_ROOT_USER $MINIO_ROOT_PASSWORD
mcli admin user svcacct add --access-key $MINIO_ACCESS_KEY --secret-key $MINIO_SECRET_KEY $MINIO_ALIAS $MINIO_ROOT_USER
Loading