-
Notifications
You must be signed in to change notification settings - Fork 472
273 lines (258 loc) · 9.6 KB
/
service_test_s3.yml
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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
name: Service Test S3
on:
push:
branches:
- main
pull_request:
branches:
- main
paths:
- "core/src/**"
- "core/tests/**"
- "!core/src/docs/**"
- "!core/src/services/**"
- "core/src/services/s3/**"
- "bindings/java/**"
- ".github/workflows/service_test_s3.yml"
- "fixtures/s3/**"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
cancel-in-progress: true
jobs:
aws_s3:
runs-on: ubuntu-latest
if: github.event_name == 'push' || !github.event.pull_request.head.repo.fork
steps:
- uses: actions/checkout@v3
- name: Setup Rust toolchain
uses: ./.github/actions/setup
with:
need-nextest: true
- name: Test
shell: bash
working-directory: core
run: cargo nextest run s3
env:
OPENDAL_S3_TEST: ${{ secrets.OPENDAL_S3_TEST }}
OPENDAL_S3_ROOT: ${{ secrets.OPENDAL_S3_ROOT }}
OPENDAL_S3_BUCKET: ${{ secrets.OPENDAL_S3_BUCKET }}
OPENDAL_S3_ENDPOINT: ${{ secrets.OPENDAL_S3_ENDPOINT }}
OPENDAL_S3_ACCESS_KEY_ID: ${{ secrets.OPENDAL_S3_ACCESS_KEY_ID }}
OPENDAL_S3_SECRET_ACCESS_KEY: ${{ secrets.OPENDAL_S3_SECRET_ACCESS_KEY }}
OPENDAL_S3_REGION: ap-northeast-1
aws_s3_with_virtual_host:
runs-on: ubuntu-latest
if: github.event_name == 'push' || !github.event.pull_request.head.repo.fork
steps:
- uses: actions/checkout@v3
- name: Setup Rust toolchain
uses: ./.github/actions/setup
with:
need-nextest: true
- name: Test
shell: bash
working-directory: core
run: cargo nextest run s3
env:
OPENDAL_S3_TEST: ${{ secrets.OPENDAL_S3_TEST }}
OPENDAL_S3_ROOT: ${{ secrets.OPENDAL_S3_ROOT }}
OPENDAL_S3_BUCKET: ${{ secrets.OPENDAL_S3_BUCKET }}
OPENDAL_S3_ENDPOINT: ${{ secrets.OPENDAL_S3_ENDPOINT }}
OPENDAL_S3_ACCESS_KEY_ID: ${{ secrets.OPENDAL_S3_ACCESS_KEY_ID }}
OPENDAL_S3_SECRET_ACCESS_KEY: ${{ secrets.OPENDAL_S3_SECRET_ACCESS_KEY }}
OPENDAL_S3_ENABLE_VIRTUAL_HOST_STYLE: on
OPENDAL_S3_REGION: ap-northeast-1
aws_s3_with_sse_c:
runs-on: ubuntu-latest
if: github.event_name == 'push' || !github.event.pull_request.head.repo.fork
steps:
- uses: actions/checkout@v3
- name: Setup Rust toolchain
uses: ./.github/actions/setup
with:
need-nextest: true
- name: Test
shell: bash
working-directory: core
run: cargo nextest run s3
env:
OPENDAL_S3_TEST: ${{ secrets.OPENDAL_S3_TEST }}
OPENDAL_S3_ROOT: ${{ secrets.OPENDAL_S3_ROOT }}
OPENDAL_S3_BUCKET: ${{ secrets.OPENDAL_S3_BUCKET }}
OPENDAL_S3_ENDPOINT: ${{ secrets.OPENDAL_S3_ENDPOINT }}
OPENDAL_S3_ACCESS_KEY_ID: ${{ secrets.OPENDAL_S3_ACCESS_KEY_ID }}
OPENDAL_S3_SECRET_ACCESS_KEY: ${{ secrets.OPENDAL_S3_SECRET_ACCESS_KEY }}
OPENDAL_S3_SERVER_SIDE_ENCRYPTION_CUSTOMER_ALGORITHM: AES256
OPENDAL_S3_SERVER_SIDE_ENCRYPTION_CUSTOMER_KEY: MDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDA=
OPENDAL_S3_SERVER_SIDE_ENCRYPTION_CUSTOMER_KEY_MD5: zZ5FnqcIqUjVwvWmyog4zw==
OPENDAL_S3_REGION: ap-northeast-1
aws_s3_with_assume_role:
runs-on: ubuntu-latest
if: github.event_name == 'push' || !github.event.pull_request.head.repo.fork
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v3
- name: Setup Rust toolchain
uses: ./.github/actions/setup
with:
need-nextest: true
- uses: actions/github-script@v6
id: id-token
with:
script: return await core.getIDToken("sts.amazonaws.com")
result-encoding: string
- name: Write ID token to file
run: echo "${{ steps.id-token.outputs.result }}" > core/tests/data/web_identity_token
- name: Test
shell: bash
working-directory: core
run: cargo nextest run s3
env:
AWS_WEB_IDENTITY_TOKEN_FILE: tests/data/web_identity_token
AWS_ROLE_ARN: arn:aws:iam::952853449216:role/opendal-testing-assume
OPENDAL_S3_TEST: on
OPENDAL_S3_ROOT: CI/
OPENDAL_S3_BUCKET: opendal-testing
OPENDAL_S3_ROLE_ARN: arn:aws:iam::952853449216:role/opendal-testing
OPENDAL_S3_REGION: ap-northeast-1
minio_s3:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup MinIO Server
shell: bash
working-directory: fixtures/s3
run: docker-compose -f docker-compose-minio.yml up -d
- name: Setup test bucket
env:
AWS_ACCESS_KEY_ID: "minioadmin"
AWS_SECRET_ACCESS_KEY: "minioadmin"
AWS_EC2_METADATA_DISABLED: "true"
run: aws --endpoint-url http://127.0.0.1:9000/ s3 mb s3://test
- name: Setup Rust toolchain
uses: ./.github/actions/setup
with:
need-nextest: true
- name: Test
shell: bash
working-directory: core
run: cargo nextest run s3
env:
OPENDAL_S3_TEST: on
OPENDAL_S3_BUCKET: test
OPENDAL_S3_ENDPOINT: "http://127.0.0.1:9000"
OPENDAL_S3_ACCESS_KEY_ID: minioadmin
OPENDAL_S3_SECRET_ACCESS_KEY: minioadmin
OPENDAL_S3_REGION: us-east-1
anonymous_minio_s3:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup MinIO Server
shell: bash
working-directory: fixtures/s3
run: |
docker-compose -f docker-compose-minio.yml up -d
- name: Setup test bucket
env:
AWS_ACCESS_KEY_ID: "minioadmin"
AWS_SECRET_ACCESS_KEY: "minioadmin"
AWS_EC2_METADATA_DISABLED: "true"
run: |
aws --endpoint-url http://127.0.0.1:9000/ s3 mb s3://test
curl -O https://dl.min.io/client/mc/release/linux-amd64/mc
chmod +x mc
./mc alias set local http://127.0.0.1:9000/ minioadmin minioadmin
./mc anonymous set public local/test
- name: Setup Rust toolchain
uses: ./.github/actions/setup
with:
need-nextest: true
- name: Test
shell: bash
working-directory: core
run: cargo nextest run s3
env:
OPENDAL_S3_TEST: on
OPENDAL_S3_BUCKET: test
OPENDAL_S3_ENDPOINT: "http://127.0.0.1:9000"
OPENDAL_S3_ALLOW_ANONYMOUS: on
OPENDAL_S3_REGION: us-east-1
r2:
runs-on: ubuntu-latest
if: (github.event_name == 'push' && github.repository == 'apache/incubator-opendal') || !github.event.pull_request.head.repo.fork
steps:
- uses: actions/checkout@v3
- name: Setup Rust toolchain
uses: ./.github/actions/setup
with:
need-nextest: true
- name: Load secret
id: op-load-secret
uses: 1password/load-secrets-action@v1
with:
export-env: true
env:
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
OPENDAL_S3_TEST: op://services/r2/test
OPENDAL_S3_BUCKET: op://services/r2/bucket
OPENDAL_S3_ENDPOINT: op://services/r2/endpoint
OPENDAL_S3_ACCESS_KEY_ID: op://services/r2/access_key_id
OPENDAL_S3_SECRET_ACCESS_KEY: op://services/r2/secret_access_key
- name: Test
shell: bash
working-directory: core
run: cargo nextest run s3
env:
OPENDAL_S3_REGION: auto
# This is the R2's limitation
# Refer to https://opendal.apache.org/docs/services/s3#compatible-services for more information
OPENDAL_S3_BATCH_MAX_OPERATIONS: 700
# This is the R2's limitation
# Refer to https://opendal.apache.org/docs/services/s3#compatible-services for more information
OPENDAL_S3_ENABLE_EXACT_BUF_WRITE: true
java:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup MinIO Server
shell: bash
working-directory: fixtures/s3
run: docker-compose -f docker-compose-minio.yml up -d
- name: Setup test bucket
env:
AWS_ACCESS_KEY_ID: "minioadmin"
AWS_SECRET_ACCESS_KEY: "minioadmin"
AWS_EC2_METADATA_DISABLED: "true"
run: aws --endpoint-url http://127.0.0.1:9000/ s3 mb s3://test
- name: Setup Rust toolchain
uses: ./.github/actions/setup
- name: Test
shell: bash
working-directory: bindings/java
run: ./mvnw test -Dtest=org.apache.opendal.test.behavior.S3Test
env:
OPENDAL_S3_TEST: on
OPENDAL_S3_BUCKET: test
OPENDAL_S3_ENDPOINT: "http://127.0.0.1:9000"
OPENDAL_S3_ACCESS_KEY_ID: minioadmin
OPENDAL_S3_SECRET_ACCESS_KEY: minioadmin
OPENDAL_S3_REGION: us-east-1