-
Notifications
You must be signed in to change notification settings - Fork 252
Feature/zenko 485 eve on s3 #1278
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,102 @@ | ||
| --- | ||
| version: 0.2 | ||
|
|
||
| branches: | ||
| feature/*, improvement/*, bugfix/*, w/*, q/*, hotfix/*: | ||
| stage: pre-merge | ||
| development/*: | ||
| stage: post-merge | ||
|
|
||
| models: | ||
| - Git: &clone | ||
| name: Pull repo | ||
| repourl: '%(prop:git_reference)s' | ||
| shallow: True | ||
| retryFetch: True | ||
| haltOnFailure: True | ||
| # Machine Setup | ||
| - ShellCommandWthSecrets: &credentials | ||
| name: Setup Credentials | ||
| command: bash eve/workers/build/credentials.bash | ||
| haltOnFailure: True | ||
| - ShellCommandWithSecrets: &npm-install | ||
| name: install modules | ||
| command: npm install | ||
| haltOnFailure: True | ||
| stages: | ||
| pre-merge: | ||
| worker: | ||
| type: local | ||
| steps: | ||
| - SetProperty: | ||
| property: artifacts_name | ||
| value: "scality-s3-%(prop:buildnumber)s" | ||
| haltOnFailure: True | ||
|
|
||
| - TriggerStages: | ||
| name: Launch all workers | ||
| stage_names: | ||
| - linting-coverage | ||
| - mongo-ft-tests | ||
| waitForFinish: True | ||
| haltOnFailure: True | ||
|
|
||
| linting-coverage: | ||
| worker: | ||
| type: docker | ||
| path: eve/workers/build | ||
| volumes: &default_volumes | ||
| - '/home/eve/workspace' | ||
| steps: | ||
| - Git: *clone | ||
| - ShellCommand: *npm-install | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shall we use yarn? It's faster.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll try it out. Should work |
||
| - ShellCommand: | ||
| name: Linting | ||
| command: | | ||
| npm run --silent lint -- --max-warnings 0 | ||
| npm run --silent lint_md | ||
| flake8 $(git ls-files "*.py") | ||
| yamllint $(git ls-files "*.yml") | ||
| - ShellCommand: | ||
| name: Unit Coverage | ||
| command: | | ||
| mkdir -p $CIRCLE_TEST_REPORTS/unit | ||
| npm run unit_coverage | ||
| npm run unit_coverage_legacy_location | ||
| haltOnFailure: True | ||
| env: | ||
| CIRCLE_TEST_REPORTS: /tmp | ||
|
|
||
| mongo-ft-tests: | ||
| worker: | ||
| type: kube_pod | ||
| path: eve/workers/pod.yaml | ||
| images: | ||
| aggressor: eve/workers/build | ||
| s3: "." | ||
| vars: &mongo-vars | ||
| S3BACKEND: "mem" | ||
| S3DATA: "" | ||
| MPU_TESTING: "yes" | ||
| S3METADATA: mongodb | ||
| CI_PROXY: "false" | ||
| steps: | ||
| - Git: *clone | ||
| - ShellCommandWithSecrets: *credentials | ||
| - ShellCommand: *npm-install | ||
| - ShellCommandWithSecrets: | ||
| command: | | ||
| . /root/.aws/exports &> /dev/null | ||
| bash wait_for_local_port.bash 8000 40 | ||
| npm run ft_test | ||
| env: | ||
| <<: *mongo-vars | ||
|
|
||
| post-merge: | ||
| worker: | ||
| type: local | ||
| steps: | ||
| - Git: *clone | ||
| - ShellCommand: | ||
| name: Nightly Build | ||
| command: docker build -t zenko/cloudserver:nightly . | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| FROM buildpack-deps:stretch-curl | ||
|
|
||
| # | ||
| # Install packages needed by the buildchain | ||
| # | ||
| ENV LANG C.UTF-8 | ||
| COPY ./s3_packages.list ./buildbot_worker_packages.list /tmp/ | ||
| RUN curl -sS http://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \ | ||
| && echo "deb http://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list \ | ||
| && apt-get update \ | ||
| && cat /tmp/*packages.list | xargs apt-get install -y \ | ||
| && git clone https://github.com/tj/n.git \ | ||
| && make -C ./n \ | ||
| && n 6 latest \ | ||
| && pip install pip==9.0.1 \ | ||
| && rm -rf ./n \ | ||
| && rm -rf /var/lib/apt/lists/* \ | ||
| && rm -f /tmp/packages.list | ||
|
|
||
| # | ||
| # Add user eve | ||
| # | ||
|
|
||
| RUN adduser -u 1042 --home /home/eve --disabled-password --gecos "" eve \ | ||
| && adduser eve sudo \ | ||
| && sed -ri 's/(%sudo.*)ALL$/\1NOPASSWD:ALL/' /etc/sudoers | ||
| # | ||
| # Install Dependencies | ||
| # | ||
|
|
||
| # Install RVM and gems | ||
| ENV RUBY_VERSION="2.4.1" | ||
| COPY ./gems.list /tmp/ | ||
| RUN cat /tmp/gems.list | xargs gem install | ||
| #RUN gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 \ | ||
| # && curl -sSL https://get.rvm.io | bash -s stable --ruby=$RUBY_VERSION \ | ||
| # && usermod -a -G rvm eve | ||
| #RUN /bin/bash -l -c "\ | ||
| # source /usr/local/rvm/scripts/rvm \ | ||
| # && cat /tmp/gems.list | xargs gem install \ | ||
| # && rm /tmp/gems.list" | ||
|
|
||
| # Install Pip packages | ||
| COPY ./pip_packages.list /tmp/ | ||
| RUN cat /tmp/pip_packages.list | xargs pip install \ | ||
| && rm -f /tmp/pip_packages.list \ | ||
| && mkdir /home/eve/.aws \ | ||
| && chown eve /home/eve/.aws | ||
|
|
||
| # | ||
| # Run buildbot-worker on startup | ||
| # | ||
|
|
||
| ARG BUILDBOT_VERSION | ||
| RUN pip install buildbot-worker==$BUILDBOT_VERSION | ||
|
|
||
| CMD ["/bin/bash", "-l", "-c", "buildbot-worker create-worker . $BUILDMASTER:$BUILDMASTER_PORT $WORKERNAME $WORKERPASS && buildbot-worker start --nodaemon"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| ca-certificates | ||
| git | ||
| gnupg | ||
| libffi-dev | ||
| libssl-dev | ||
| python-pip | ||
| python2.7 | ||
| python2.7-dev | ||
| software-properties-common | ||
| sudo | ||
| tcl | ||
| wget | ||
| procps |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| #!/bin/bash -x | ||
| set -x #echo on | ||
| set -e #exit at the first error | ||
|
|
||
| mkdir -p ~/.aws | ||
| cat >>/root/.aws/exports <<EOF | ||
| export AWS_ACCESS_KEY_ID= | ||
| export AWS_SECRET_ACCESS_KEY= | ||
| export GOOGLE_SERVICE_EMAIL="$GCP_BACKEND_SERVICE_EMAIL" | ||
| export GOOGLE_SERVICE_KEY="$GCP_BACKEND_SERVICE_KEY" | ||
| export azurebackend2_AZURE_STORAGE_ACCESS_KEY="$AZURE_BACKEND_ACCESS_KEY_2" | ||
| export azurebackend2_AZURE_STORAGE_ACCOUNT_NAME="$AZURE_BACKEND_ACCOUNT_NAME_2" | ||
| export azurebackend2_AZURE_STORAGE_ENDPOINT="$AZURE_BACKEND_ENDPOINT_2" | ||
| export azurebackend_AZURE_STORAGE_ACCESS_KEY="$AZURE_BACKEND_ACCESS_KEY" | ||
| export azurebackend_AZURE_STORAGE_ACCOUNT_NAME="$AZURE_BACKEND_ACCOUNT_NAME" | ||
| export azurebackend_AZURE_STORAGE_ENDPOINT="$AZURE_BACKEND_ENDPOINT" | ||
| export azurebackendmismatch_AZURE_STORAGE_ACCESS_KEY="$AZURE_BACKEND_ACCESS_KEY" | ||
| export azurebackendmismatch_AZURE_STORAGE_ACCOUNT_NAME="$AZURE_BACKEND_ACCOUNT_NAME" | ||
| export azurebackendmismatch_AZURE_STORAGE_ENDPOINT="$AZURE_BACKEND_ENDPOINT" | ||
| export azurenonexistcontainer_AZURE_STORAGE_ACCESS_KEY="$AZURE_BACKEND_ACCESS_KEY" | ||
| export azurenonexistcontainer_AZURE_STORAGE_ACCOUNT_NAME="$AZURE_BACKEND_ACCOUNT_NAME" | ||
| export azurenonexistcontainer_AZURE_STORAGE_ENDPOINT="$AZURE_BACKEND_ENDPOINT" | ||
| export azuretest_AZURE_BLOB_ENDPOINT="$AZURE_BACKEND_ENDPOINT" | ||
| EOF | ||
|
|
||
| source /root/.aws/exports &> /dev/null | ||
| cat >>/root/.aws/credentials <<EOF | ||
| [default] | ||
| aws_access_key_id = $AWS_S3_BACKEND_ACCESS_KEY | ||
| aws_secret_access_key = $AWS_S3_BACKEND_SECRET_KEY | ||
| [default_2] | ||
| aws_access_key_id = $AWS_S3_BACKEND_ACCESS_KEY_2 | ||
| aws_secret_access_key = $AWS_S3_BACKEND_SECRET_KEY_2 | ||
| [google] | ||
| aws_access_key_id = $AWS_GCP_BACKEND_ACCESS_KEY | ||
| aws_secret_access_key = $AWS_GCP_BACKEND_SECRET_KEY | ||
| [google_2] | ||
| aws_access_key_id = $AWS_GCP_BACKEND_ACCESS_KEY_2 | ||
| aws_secret_access_key = $AWS_GCP_BACKEND_SECRET_KEY_2 | ||
| EOF | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| fog-aws:1.3.0 | ||
| json | ||
| mime-types:3.1 | ||
| rspec:3.5 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| flake8 | ||
| s3cmd==1.6.1 | ||
| yamllint |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| build-essential | ||
| curl | ||
| default-jdk | ||
| libdigest-hmac-perl | ||
| lsof | ||
| maven | ||
| netcat | ||
| redis-server | ||
| ruby-full | ||
| yarn=1.7.0-1 | ||
| zlib1g-dev |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. just curious as to why only the
package.jsonis copied here rather than the whole dirUh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So this is where the magic of docker layers becomes useful. So say you are changing code and need to rebuild your docker image to test but you dependencies stay the same. If this was built previously, then on consecutive runs Docker will skip this step along with the following RUN step where all the system packages and npm packages are installed and use the cached layers from the previous builds.
It then will use the step at line 18 to copy the remaining code base into the image which wont be cached because of code changes.