-
Notifications
You must be signed in to change notification settings - Fork 21
155 lines (128 loc) · 4.62 KB
/
nightly.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
---
name: Nightly Builds
on:
schedule:
- cron: '0 0 * * *' # Every night midnight
# This workflow needs to pass if there is a PR changing it.
pull_request:
paths:
- ".github/workflows/nightly.yaml"
workflow_dispatch: # Or manually - for testing
jobs:
build-and-test:
runs-on: self-hosted
steps:
- name: Checkout
uses: actions/checkout@v3
with:
path: s3gw
submodules: true
- name: Checkout Ceph HEAD
working-directory: s3gw/ceph
run: |
git fetch
git checkout s3gw
git submodule update --init --recursive
- name: Checkout s3tests
uses: actions/checkout@v3
with:
repository: ceph/s3-tests
path: s3tests
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install Dependencies
run: |
YQ_GH_URL=https://github.com/mikefarah/yq/releases/download
YQ_VERSION=v4.31.1
YQ_CHECKSUM=1aef844cbecbbf81036449ea5e7dfcdf19d2d374fab6303fdb8f849d04275d76
sudo apt-get update
sudo apt-get install -y \
bc \
wget \
s3cmd
# Unfortunately, since yq is only available through snap on Ubuntu and
# that doesn't work in docker containers (at least not out of the
# box), this abomination is the way to go to install yq.
echo "${YQ_CHECKSUM} yq" >> checksum
wget -O yq "${YQ_GH_URL}/${YQ_VERSION}/yq_linux_amd64"
sha256sum -c checksum \
&& sudo mv yq /usr/bin/yq \
&& sudo chmod +x /usr/bin/yq
# known to work version of boto3
python3 -m pip install boto3==1.24.96
python3 -m pip install -r s3tests/requirements.txt
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Context
run: |
docker context create builder
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
endpoint: builder
- name: Quay Login
uses: docker/login-action@v2
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_PASSWORD }}
- name: Generate Tag based on Date
id: date
run: |
DATE="$(date +%Y-%m-%d)"
echo "tag=nightly-${DATE}" >> $GITHUB_OUTPUT
- name: Build Nightly Container
uses: docker/build-push-action@v3
with:
push: true
build-args: |
CMAKE_BUILD_TYPE=Release
S3GW_VERSION=${{ steps.date.outputs.tag }}
NPROC=16
QUAY_EXPIRATION=1w
tags: |
quay.io/s3gw/s3gw:${{ steps.date.outputs.tag }}
quay.io/s3gw/s3gw:nightly-latest
file: s3gw/Dockerfile
context: s3gw
- name: Run S3tests
env:
GITHUB_TOKEN: ${{ secrets.STATUS_PUSH_TOKEN }}
run: |
set +e # don't exit on error
set -x
# needed for GNU parallel because the version in GH runners is bugged
mkdir -p ${HOME}/.parallel
export DEBUG=1
export S3TEST_PARALLEL=ON
export CEPH_DIR="${GITHUB_WORKSPACE}/s3gw/ceph"
export OUTPUT_DIR="${GITHUB_WORKSPACE}/s3test-results"
export S3GW_CONTAINER="quay.io/s3gw/s3gw:nightly-latest"
export FORCE_CONTAINER=ON
export FORCE_DOCKER=ON
export \
FIXTURES="${CEPH_DIR}/qa/rgw/store/sfs/tests/fixtures"
export S3TEST_REPO="${GITHUB_WORKSPACE}/s3tests"
export S3TEST_CONF="${FIXTURES}/s3tests.conf"
export S3TEST_LIST="${FIXTURES}/s3-tests.txt"
# There are some s3tests that don't finish at all. Only run
# known-to-pass tests for now. TODO: fix inifite looping tests
# sed -r -i 's/^# //' "${S3TEST_LIST}"
pushd s3tests
${GITHUB_WORKSPACE}/s3gw/tools/tests/s3tests-runner.sh
popd
git clone \
https://user:${GITHUB_TOKEN}@github.com/aquarist-labs/s3gw-status
pushd s3gw-status
git config user.name "github nightly bot"
git config user.email "[email protected]"
cp \
"${OUTPUT_DIR}/report.json" \
results/s3tests/${{ steps.date.outputs.tag }}.json
git add results/s3tests/${{ steps.date.outputs.tag }}.json
git commit -m "Nightly Results $(date +%Y-%m-%d)"
git push
# We expect some tests to fail, we just want to see _which_ tests fail
# exit 0