Compare commits
1 Commits
developmen
...
improvemen
Author | SHA1 | Date |
---|---|---|
williamlardier | ad2cf0f800 |
|
@ -39,7 +39,7 @@ runs:
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get install -y libdigest-hmac-perl
|
sudo apt-get install -y libdigest-hmac-perl
|
||||||
pip install virtualenv
|
pip install virtualenv==20.21.0
|
||||||
virtualenv -p $(which python2) ~/.virtualenv/py2
|
virtualenv -p $(which python2) ~/.virtualenv/py2
|
||||||
source ~/.virtualenv/py2/bin/activate
|
source ~/.virtualenv/py2/bin/activate
|
||||||
pip install 's3cmd==1.6.1'
|
pip install 's3cmd==1.6.1'
|
||||||
|
|
|
@ -73,7 +73,7 @@ services:
|
||||||
mongo:
|
mongo:
|
||||||
network_mode: "host"
|
network_mode: "host"
|
||||||
profiles: ['mongo', 'ceph']
|
profiles: ['mongo', 'ceph']
|
||||||
image: scality/ci-mongo:3.6.8
|
image: ${MONGODB_IMAGE}
|
||||||
ceph:
|
ceph:
|
||||||
network_mode: "host"
|
network_mode: "host"
|
||||||
profiles: ['ceph']
|
profiles: ['ceph']
|
||||||
|
|
|
@ -0,0 +1,58 @@
|
||||||
|
FROM mongo:4.2.24
|
||||||
|
|
||||||
|
ENV USER=scality \
|
||||||
|
HOME_DIR=/home/scality \
|
||||||
|
CONF_DIR=/conf \
|
||||||
|
DATA_DIR=/data
|
||||||
|
|
||||||
|
# Set up directories and permissions
|
||||||
|
RUN mkdir -p /data/db /data/configdb && chown -R mongodb:mongodb /data/db /data/configdb; \
|
||||||
|
mkdir /logs; \
|
||||||
|
adduser --uid 1000 --disabled-password --gecos --quiet --shell /bin/bash scality
|
||||||
|
|
||||||
|
# Set up environment variables and directories for scality user
|
||||||
|
RUN mkdir ${CONF_DIR} && \
|
||||||
|
chown -R ${USER} ${CONF_DIR} && \
|
||||||
|
chown -R ${USER} ${DATA_DIR}
|
||||||
|
|
||||||
|
# Create the mongod.conf file
|
||||||
|
RUN echo "storage:
|
||||||
|
journal:
|
||||||
|
enabled: true
|
||||||
|
engine: wiredTiger
|
||||||
|
dbPath: \"/data/db\"
|
||||||
|
processManagement:
|
||||||
|
fork: false
|
||||||
|
net:
|
||||||
|
port: 27018
|
||||||
|
bindIp: 0.0.0.0
|
||||||
|
replication:
|
||||||
|
replSetName: \"rs0\"
|
||||||
|
enableMajorityReadConcern: true
|
||||||
|
security:
|
||||||
|
authorization: disabled" > ${CONF_DIR}/mongod.conf
|
||||||
|
|
||||||
|
# Create the mongo-run.sh file
|
||||||
|
RUN echo "#!/bin/bash
|
||||||
|
set -exo pipefail
|
||||||
|
|
||||||
|
init_RS() {
|
||||||
|
sleep 5
|
||||||
|
mongo --port 27018 /conf/initReplicaSet.js
|
||||||
|
}
|
||||||
|
init_RS &
|
||||||
|
|
||||||
|
mongod --bind_ip_all --config=/conf/mongod.conf" > ${CONF_DIR}/mongo-run.sh && chmod +x ${CONF_DIR}/mongo-run.sh
|
||||||
|
|
||||||
|
# Create the initReplicaSet.js file
|
||||||
|
RUN echo "rs.initiate({
|
||||||
|
_id: \"rs0\",
|
||||||
|
members: [{ _id: 0, host: \"127.0.0.1:27018\" }]
|
||||||
|
});" > ${CONF_DIR}/initReplicaSet.js
|
||||||
|
|
||||||
|
EXPOSE 27017/tcp
|
||||||
|
EXPOSE 27018
|
||||||
|
|
||||||
|
# Set up CMD
|
||||||
|
ENTRYPOINT ["bash", "/conf/mongo-run.sh"]
|
||||||
|
CMD ["bash", "/conf/mongo-run.sh"]
|
|
@ -153,6 +153,14 @@ jobs:
|
||||||
registry.scality.com/cloudserver-dev/cloudserver:${{ github.sha }}
|
registry.scality.com/cloudserver-dev/cloudserver:${{ github.sha }}
|
||||||
cache-from: type=gha,scope=cloudserver
|
cache-from: type=gha,scope=cloudserver
|
||||||
cache-to: type=gha,mode=max,scope=cloudserver
|
cache-to: type=gha,mode=max,scope=cloudserver
|
||||||
|
- name: Build and push MongoDB
|
||||||
|
uses: docker/build-push-action@v2
|
||||||
|
with:
|
||||||
|
push: true
|
||||||
|
context: .github/dockerfiles/mongodb
|
||||||
|
tags: ghcr.io/scality/${{ github.repository }}/ci-mongodb:${{ github.sha }}
|
||||||
|
cache-from: type=gha
|
||||||
|
cache-to: type=gha,mode=max
|
||||||
|
|
||||||
multiple-backend:
|
multiple-backend:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
@ -198,11 +206,18 @@ jobs:
|
||||||
S3KMS: file
|
S3KMS: file
|
||||||
S3_LOCATION_FILE: /usr/src/app/tests/locationConfig/locationConfigTests.json
|
S3_LOCATION_FILE: /usr/src/app/tests/locationConfig/locationConfigTests.json
|
||||||
DEFAULT_BUCKET_KEY_FORMAT: v0
|
DEFAULT_BUCKET_KEY_FORMAT: v0
|
||||||
|
MONGODB_IMAGE: ghcr.io/scality/${{ github.repository }}/ci-mongodb:${{ github.sha }}
|
||||||
CLOUDSERVER_IMAGE: ghcr.io/${{ github.repository }}/cloudserver:${{ github.sha }}
|
CLOUDSERVER_IMAGE: ghcr.io/${{ github.repository }}/cloudserver:${{ github.sha }}
|
||||||
JOB_NAME: ${{ github.job }}
|
JOB_NAME: ${{ github.job }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
- name: Login to Scality Registry
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
registry: registry.scality.com
|
||||||
|
username: ${{ secrets.REGISTRY_LOGIN }}
|
||||||
|
password: ${{ secrets.REGISTRY_PASSWORD }}
|
||||||
- name: Setup CI environment
|
- name: Setup CI environment
|
||||||
uses: ./.github/actions/setup-ci
|
uses: ./.github/actions/setup-ci
|
||||||
- name: Setup CI services
|
- name: Setup CI services
|
||||||
|
@ -237,11 +252,18 @@ jobs:
|
||||||
S3_LOCATION_FILE: /usr/src/app/tests/locationConfig/locationConfigTests.json
|
S3_LOCATION_FILE: /usr/src/app/tests/locationConfig/locationConfigTests.json
|
||||||
DEFAULT_BUCKET_KEY_FORMAT: v1
|
DEFAULT_BUCKET_KEY_FORMAT: v1
|
||||||
METADATA_MAX_CACHED_BUCKETS: 1
|
METADATA_MAX_CACHED_BUCKETS: 1
|
||||||
|
MONGODB_IMAGE: ghcr.io/scality/${{ github.repository }}/ci-mongodb:${{ github.sha }}
|
||||||
CLOUDSERVER_IMAGE: ghcr.io/${{ github.repository }}/cloudserver:${{ github.sha }}
|
CLOUDSERVER_IMAGE: ghcr.io/${{ github.repository }}/cloudserver:${{ github.sha }}
|
||||||
JOB_NAME: ${{ github.job }}
|
JOB_NAME: ${{ github.job }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
- name: Login to Scality Registry
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
registry: registry.scality.com
|
||||||
|
username: ${{ secrets.REGISTRY_LOGIN }}
|
||||||
|
password: ${{ secrets.REGISTRY_PASSWORD }}
|
||||||
- name: Setup CI environment
|
- name: Setup CI environment
|
||||||
uses: ./.github/actions/setup-ci
|
uses: ./.github/actions/setup-ci
|
||||||
- name: Setup CI services
|
- name: Setup CI services
|
||||||
|
@ -387,6 +409,7 @@ jobs:
|
||||||
CI_CEPH: 'true'
|
CI_CEPH: 'true'
|
||||||
MPU_TESTING: "yes"
|
MPU_TESTING: "yes"
|
||||||
S3_LOCATION_FILE: /usr/src/app/tests/locationConfig/locationConfigCeph.json
|
S3_LOCATION_FILE: /usr/src/app/tests/locationConfig/locationConfigCeph.json
|
||||||
|
MONGODB_IMAGE: ghcr.io/scality/${{ github.repository }}/ci-mongodb:${{ github.sha }}
|
||||||
CLOUDSERVER_IMAGE: ghcr.io/${{ github.repository }}/cloudserver:${{ github.sha }}
|
CLOUDSERVER_IMAGE: ghcr.io/${{ github.repository }}/cloudserver:${{ github.sha }}
|
||||||
JOB_NAME: ${{ github.job }}
|
JOB_NAME: ${{ github.job }}
|
||||||
steps:
|
steps:
|
||||||
|
@ -398,6 +421,12 @@ jobs:
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
username: ${{ github.repository_owner }}
|
username: ${{ github.repository_owner }}
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
- name: Login to Scality Registry
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
registry: registry.scality.com
|
||||||
|
username: ${{ secrets.REGISTRY_LOGIN }}
|
||||||
|
password: ${{ secrets.REGISTRY_PASSWORD }}
|
||||||
- name: Setup CI environment
|
- name: Setup CI environment
|
||||||
uses: ./.github/actions/setup-ci
|
uses: ./.github/actions/setup-ci
|
||||||
- uses: ruby/setup-ruby@v1
|
- uses: ruby/setup-ruby@v1
|
||||||
|
|
Loading…
Reference in New Issue