diff --git a/.github/services/s3/ceph_rados_s3/action.yml b/.github/services/s3/ceph_rados_s3/action.yml new file mode 100644 index 000000000000..a1de85f2ba4f --- /dev/null +++ b/.github/services/s3/ceph_rados_s3/action.yml @@ -0,0 +1,50 @@ +# 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: ceph_rados_s3 +description: 'Behavior test for CEPH OBJECT GATEWAY S3.' + +runs: + using: "composite" + steps: + - name: Setup MinIO Server + shell: bash + working-directory: fixtures/s3 + run: docker compose -f docker-compose-minio.yml up -d --wait + - name: Set up AWS CLI + shell: bash + run: | + echo "AWS_ACCESS_KEY_ID=ceph_rados_s3_admin" >> $GITHUB_ENV + echo "AWS_SECRET_ACCESS_KEY=ceph_rados_s3_admin" >> $GITHUB_ENV + echo "AWS_DEFAULT_REGION=us-east-1" >> $GITHUB_ENV + - name: Setup test bucket + shell: bash + env: + AWS_ACCESS_KEY_ID: "ceph_rados_s3_admin" + AWS_SECRET_ACCESS_KEY: "ceph_rados_s3_admin" + AWS_EC2_METADATA_DISABLED: "true" + run: aws --endpoint-url http://127.0.0.1:8000/ s3 mb s3://test + - name: Setup + shell: bash + run: | + cat << EOF >> $GITHUB_ENV + OPENDAL_S3_BUCKET=test + OPENDAL_S3_ENDPOINT=http://127.0.0.1:8000 + OPENDAL_S3_ACCESS_KEY_ID=ceph_rados_s3_admin + OPENDAL_S3_SECRET_ACCESS_KEY=ceph_rados_s3_admin + OPENDAL_S3_REGION=us-east-1 + EOF \ No newline at end of file diff --git a/fixtures/s3/docker-compose-ceph-rados.yml b/fixtures/s3/docker-compose-ceph-rados.yml new file mode 100644 index 000000000000..68780edaa16d --- /dev/null +++ b/fixtures/s3/docker-compose-ceph-rados.yml @@ -0,0 +1,53 @@ +# 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. + +version: '3.8' + +services: + ceph-rgw: + image: ceph/daemon:latest + network_mode: host + environment: + - CEPH_DAEMON=rgw + - RGW_FRONTEND_PORT=8000 + - RGW_CIVETWEB_PORT=8000 + - CEPH_PUBLIC_NETWORK=0.0.0.0/0 + - CEPH_CLUSTER_NAME=myceph + - CEPH_RGW_FRONTEND_TYPE=beast + volumes: + - /var/lib/ceph/:/var/lib/ceph/ + + rgw-admin-user-setup: + image: ceph/ceph:v16 + entrypoint: /bin/sh + command: -c "radosgw-admin user create --uid=admin --display-name=Admin --email=admin@example.com" + depends_on: + - ceph-rgw + environment: + - CEPH_CLUSTER_NAME=myceph + - CEPH_RGW_FRONTEND_TYPE=beast + + rgw-admin-secret-setup: + image: ceph/ceph:v16 + entrypoint: /bin/sh + command: -c "radosgw-admin user info --uid=admin" + depends_on: + - rgw-admin-user-setup + environment: + - CEPH_CLUSTER_NAME=myceph + - CEPH_RGW_FRONTEND_TYPE=beast +