Skip to content
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
75 changes: 73 additions & 2 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
---
name: Pull request
on:
- push
- pull_request
push:
branches:
- main
pull_request:
jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -20,3 +22,72 @@ jobs:

- name: Test
run: make test
compliance-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Build
run: make build

- name: Checkout compliance test suite
uses: actions/checkout@v3
with:
repository: stackhpc/s3-active-storage-compliance-suite
path: compliance

- name: Setup python
uses: actions/setup-python@v4

- name: Install compliance test suite dependencies
run: pip install -r requirements.txt
working-directory: compliance

- name: Configure compliance test suite
run: |
echo 'PROXY_URL = "http://localhost:8080"' >> compliance/config.py
working-directory: compliance

- name: Start minio object storage
run: scripts/minio-start

- name: Wait for minio object storage to start
run: |
until curl -if http://localhost:9001; do
sleep 1;
done

- name: Run active storage container
run: make run

- name: Wait for active storage server to start
run: |
until curl -if http://localhost:8080/.well-known/s3-active-storage-schema; do
sleep 1;
done

- name: Create artifacts directory
run: mkdir artifacts

- name: Run compliance test suite
run: pytest -s > artifacts/pytest.log

- name: Get active storage logs
run: docker logs s3-active-storage > artifacts/s3-active-storage.log
if: always()

- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: compliance-test
path: artifacts
if: always()

- name: Stop minio object storage
run: scripts/minio-stop
if: always()

- name: Stop active storage container
run: make stop
if: always()
4 changes: 4 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,9 @@ RUN cargo install --path .

# Stage 2: final image
FROM debian:bullseye-slim
# AWS SDK requires CA certificates to be present.
RUN apt update \
&& apt install -y --no-install-recommends ca-certificates \
&& update-ca-certificates
COPY --from=builder /usr/local/cargo/bin/s3-active-storage /usr/local/bin/s3-active-storage
CMD ["s3-active-storage"]
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,8 @@ test:

.PHONY: run
run:
@docker run -it --rm --net=host --name s3-active-storage s3-active-storage
@docker run -it --detach --rm --net=host --name s3-active-storage s3-active-storage

.PHONY: stop
stop:
@docker stop s3-active-storage
18 changes: 0 additions & 18 deletions scripts/minio-run

This file was deleted.

4 changes: 4 additions & 0 deletions scripts/minio-start
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env bash

# Use anon storage volume so that test data is removed when container is stopped
exec docker run --detach --rm -p 9000:9000 -p 9001:9001 -v :/data --name minio minio/minio server data --console-address ":9001"
3 changes: 3 additions & 0 deletions scripts/minio-stop
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env bash

exec docker stop minio