Skip to content
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

WIP: Versioned images and release on pypi #65

Open
wants to merge 190 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
190 commits
Select commit Hold shift + click to select a range
a79de65
Remove cornerstone django app addition
silviot Feb 26, 2020
ac3fdd9
Use new style images
silviot Feb 26, 2020
b5dd3c5
Explicitly set needed NO_PREREQ_INSTALL and NO_PYTHON_UNINSTALL vars
silviot Feb 26, 2020
c085280
Split rmlint commands in three lines (they fail misteriously
silviot Feb 26, 2020
76dd16d
Add info messages wrt rmlint
silviot Feb 26, 2020
3d7ec12
Fix rmlint invocation
silviot Feb 26, 2020
5a62d80
Constrain edx versions when installing requirements
silviot Feb 27, 2020
e7479dd
Fix base image: it should be nostatic
silviot Feb 27, 2020
1f1e937
Add stage Test
silviot Feb 27, 2020
68caa67
Include image generation in this project
silviot Feb 27, 2020
cd2cc12
Test how long it takes without precompilation
silviot Feb 27, 2020
b4e01c9
Install numpy first or else scipy freaks out
silviot Feb 27, 2020
35bb5a4
Remove unnecessary --run-syncdb
silviot Feb 28, 2020
8e7ad26
Improve wheel compilation
silviot Feb 28, 2020
e490534
Remove dump image: the dump is now performed in a single self-contain…
silviot Feb 28, 2020
ae6b1d8
Add blas-dev needed by older (hawthorn/ironwood) scipy
silviot Feb 28, 2020
bc3e86c
Reset layers cache
silviot Feb 28, 2020
881f94d
Use docker buildx instead of buildctl
silviot Feb 28, 2020
a448dfe
Bump layers cache
silviot Feb 28, 2020
5facafe
New command `derex build openedx` to build base images
silviot Feb 28, 2020
23b829c
Restore sanity on cache keys (I removed CACHE_KEY_FALLBACK by mistake)
silviot Feb 28, 2020
3140055
Update invocations in azure pipelines
silviot Feb 28, 2020
e595e5b
Fix juniper branch name
silviot Mar 1, 2020
c0bb07f
WIP prepare push-after-test
silviot Mar 1, 2020
5a7f1b8
WIP
silviot Mar 1, 2020
cfba7a5
WIP
silviot Mar 1, 2020
e9454bc
Refactor image restore from artifacts
silviot Mar 2, 2020
b41eba3
Load image from artifacts in ironwood too
silviot Mar 2, 2020
363d9f1
Fix path
silviot Mar 2, 2020
a4fc339
Restore tests
silviot Mar 2, 2020
3e9dfc4
fix
silviot Mar 2, 2020
aba962c
Move DOCKER_IMAGES_SLUG
silviot Mar 2, 2020
56c7e43
Try to find a spot for DOCKER_IMAGES_SLUG
silviot Mar 2, 2020
a6ce309
Use docker format
silviot Mar 2, 2020
f2790cd
Do not load images when not necessary (coverage combine and docs test)
silviot Mar 2, 2020
19c64b1
STart to build sentinel cache
silviot Mar 2, 2020
266b08d
WIP
silviot Mar 2, 2020
20a26c3
Try to move variables to pipeline context
silviot Mar 2, 2020
76dad45
fix
silviot Mar 2, 2020
4a06db9
Use cache instead of artifacts to share image build result
silviot Mar 2, 2020
351f0b1
Do the docker save in a separate step
silviot Mar 2, 2020
95f1b15
Compress image cache with pxz
silviot Mar 2, 2020
f501859
Fix sentinel cache
silviot Mar 2, 2020
b07bb45
Fix step displayName
silviot Mar 2, 2020
bae5ce3
Use xz, not pxz
silviot Mar 2, 2020
3e6ae78
Install pxz
silviot Mar 2, 2020
1b00db5
fix
silviot Mar 2, 2020
45143a1
Also try xz to see if pxz is worth it
silviot Mar 2, 2020
04d7f89
Try different compression settings
silviot Mar 2, 2020
5a47d26
Retry pxz
silviot Mar 2, 2020
9d65ad7
Make sure to use a different cache for different edx versions
silviot Mar 2, 2020
399d263
Using -0 as compression settings for xz.
silviot Mar 2, 2020
ffb5062
Only python slow tests need the image
silviot Mar 2, 2020
966790c
test
silviot Mar 2, 2020
c72512b
Try to reset caches
silviot Mar 2, 2020
37be06b
Try out image before running reset-mysql
silviot Mar 2, 2020
46aa7de
Reduce number of docker layers
silviot Mar 2, 2020
fb089ad
Reduce docker layers
silviot Mar 2, 2020
c8b594f
Do not pull edx images: we have them from the azure environment
silviot Mar 2, 2020
5e9b4ca
Reduce number of layers
silviot Mar 2, 2020
b2c2a12
Move rmlint to nostatic
silviot Mar 2, 2020
c9f5061
Fix dockerfile mistake
silviot Mar 2, 2020
73a52d2
Suggest to create an azure pipeline
silviot Mar 3, 2020
b3ba6be
Fix dockerfile
silviot Mar 3, 2020
5b79634
Only push when a new image was built
silviot Mar 3, 2020
978e842
Remove docker credentials from build stage
silviot Mar 3, 2020
6755356
Prepare to include translations
silviot Mar 3, 2020
a3bbeb2
Reduce number of layers
silviot Mar 3, 2020
f1d3e1f
Reduce number of layers
silviot Mar 3, 2020
947bcb4
Also update translations
silviot Mar 3, 2020
d809203
Work around transifex client issue
silviot Mar 3, 2020
0289a73
Also include Italian and German translations
silviot Mar 3, 2020
19ab905
Reset caches
silviot Mar 3, 2020
2b47ae6
Actually dowload new translations
silviot Mar 3, 2020
55123e8
Reset cache
silviot Mar 3, 2020
6559583
Use HOME instead of ~
silviot Mar 3, 2020
90539f8
Try to only directly invoke derex build
silviot Mar 3, 2020
6287ec9
Echo value of DEREX_OPTS
silviot Mar 3, 2020
b0c4749
Reset caches
silviot Mar 3, 2020
124dba6
Store cache options in DOCKER_OPTS, not in DOCKER_COMMAND
silviot Mar 3, 2020
207073b
reset caches
silviot Mar 3, 2020
cbd5131
Back to running docker directly
silviot Mar 3, 2020
5c0d86d
basebase → base
silviot Mar 3, 2020
43636ed
Reset caches and do not install derex to build images
silviot Mar 3, 2020
c693484
Bind image and layers keys: if one is reset, so should the other one
silviot Mar 4, 2020
c3bbd63
debug
silviot Mar 4, 2020
34e69ec
Do not pass through local docker images: dump image to disk immediately
silviot Mar 4, 2020
a85be8c
assets.py must be present before translations download
silviot Mar 4, 2020
1af1746
Reset caches
silviot Mar 4, 2020
c55b86f
Make sure we catch errors with docker invocation
silviot Mar 4, 2020
613bd77
Stop build in case of error
silviot Mar 4, 2020
3f85a02
Continue on error
silviot Mar 4, 2020
ee7ddd0
Reset cache
silviot Mar 4, 2020
e0c3e44
Better rmlint invocation
silviot Mar 4, 2020
e508aca
Remove redundant directive
silviot Mar 4, 2020
4bfb77d
Fix rmlint invocation
silviot Mar 4, 2020
56cb132
Debug needs_build
silviot Mar 4, 2020
11a4c3c
Do not fail the build in case of translation problems
silviot Mar 4, 2020
131e592
Remove set -x
silviot Mar 4, 2020
e5a1574
Add comment ot invalidate image cache
silviot Mar 4, 2020
a16171b
Try to show needs_build variable
silviot Mar 4, 2020
2cfdab5
Reverse build check to make it work even with spurious quotation marks
silviot Mar 4, 2020
b79413f
Remove check step
silviot Mar 4, 2020
5cf70bb
Reset cache
silviot Mar 4, 2020
c34dd04
Fix push conditions
silviot Mar 4, 2020
771a9f7
Check translations only during build
silviot Mar 4, 2020
ac752f1
Do not download Basque translations (they are currently broken)
silviot Mar 4, 2020
03d8537
Do not write to cache while tagging the translations image
silviot Mar 4, 2020
13f225e
Fix push conditions
silviot Mar 4, 2020
088ac59
Add a default to enable testing with bare docker run
silviot Mar 4, 2020
adf3ffd
Add target parameter to build specific target
silviot Mar 4, 2020
757f78b
Add docker-opts option to derex build openedx
silviot Mar 4, 2020
b843e92
Better use of caching
silviot Mar 4, 2020
33d406f
Install derex to build images
silviot Mar 4, 2020
3d56ea3
Fix derex invocation
silviot Mar 5, 2020
32eba65
Test
silviot Mar 5, 2020
71b016e
Test
silviot Mar 5, 2020
18575d6
Fix derex build invocation
silviot Mar 5, 2020
9d4baf9
Upgrade dive
silviot Mar 5, 2020
a0accb9
Refactor images cache key
silviot Mar 5, 2020
29f060f
Testing
silviot Mar 5, 2020
afd7411
Fix images cache key
silviot Mar 5, 2020
f461276
Support conditional derex install
silviot Mar 5, 2020
0b48ef5
Prevent overstoring useless layers to layers cache
silviot Mar 5, 2020
ee6b14e
Revert "Test"
silviot Mar 5, 2020
e73e289
debug
silviot Mar 5, 2020
d2ffb4a
Reset cache
silviot Mar 5, 2020
f4d50f9
Fix translations
silviot Mar 5, 2020
a983878
Fix translations image generation
silviot Mar 5, 2020
99c44d5
Fix image cache key in load images
silviot Mar 5, 2020
41932dd
Improve azure variable naming
silviot Mar 5, 2020
04e6ca3
Fix images cache key
silviot Mar 5, 2020
e956617
Reset image cache
silviot Mar 5, 2020
f93e481
Document nostatic image
silviot Mar 6, 2020
9747fd9
Tag image when building
silviot Mar 6, 2020
b06a0e5
Document the nostatic-dev image
silviot Mar 6, 2020
0d411f2
Document why we save built_version
silviot Mar 6, 2020
6135e39
Fix bumpversion conf: version is not present as literal in docs/conf.py
silviot Mar 6, 2020
69bf67e
Build/push versioned images
silviot Mar 6, 2020
0a7c7bb
Use current image version in derex project
silviot Mar 6, 2020
04ca084
Document nostatic-dev image
silviot Mar 6, 2020
95e58f6
Build/upload to test pypi
silviot Mar 6, 2020
2a79a28
Test
silviot Mar 6, 2020
c4cd452
Do not end-of-file check bumpversion: it really wants to rewrite the …
silviot Mar 6, 2020
b6301c3
FIx bumpversion conf
silviot Mar 6, 2020
4a8e03c
Also save version as env variable in docker images
silviot Mar 6, 2020
6b14330
Back to full build
silviot Mar 6, 2020
82f8e99
Fix bumpversion
silviot Mar 6, 2020
b868381
Bump version: 0.0.1 → 0.0.2
silviot Mar 7, 2020
052b393
Fix tag of tested translations image
silviot Mar 7, 2020
69d3b1c
Make sure the load images step fails in case of problem
silviot Mar 7, 2020
60785da
Document libgeos image
silviot Mar 7, 2020
d302d60
Reset layers cache
silviot Mar 7, 2020
6558eb2
Bump version: 0.0.2 → 0.0.3
silviot Mar 7, 2020
5ae2b77
Also explicitly cache early layers
silviot Mar 7, 2020
9ba8276
Bump version: 0.0.3 → 0.0.4
silviot Mar 7, 2020
6d0641c
Specify we need at least python 3.6
silviot Mar 7, 2020
476b471
Upgrade versions. Also change bumpversion → bump2version
silviot Mar 7, 2020
88a1ce6
Bump version: 0.0.4 → 0.0.5
silviot Mar 7, 2020
6c409fc
Bump version: 0.0.5 → 0.0.6
silviot Mar 7, 2020
342bb5b
Bump version: 0.0.6 → 0.0.7
silviot Mar 7, 2020
6f4527a
Do not fail the build because pypi push failed
silviot Mar 7, 2020
18f06da
Include version only in dev image: including it elsewhere will invali…
silviot Mar 8, 2020
42002a3
Bump version: 0.0.7 → 0.0.8
silviot Mar 8, 2020
fecaa03
Bump version: 0.0.8 → 0.0.9
silviot Mar 8, 2020
a1403c1
Also read from the fresh cache
silviot Mar 8, 2020
e32759e
Make sure to return non-0 in case of error by using execve
silviot Mar 8, 2020
42e4c79
Reset layers cache
silviot Mar 8, 2020
97a851a
Bump version: 0.0.9 → 0.0.10
silviot Mar 8, 2020
bb28e0c
Bump version: 0.0.10 → 0.0.11
silviot Mar 8, 2020
0a7192e
Bump version: 0.0.11 → 0.0.12
silviot Mar 8, 2020
077d675
Add --only-print-image-name option to derex build
silviot Mar 10, 2020
0ac3956
Get rid of layers cache
silviot Mar 10, 2020
03f9b2c
Fix condition
silviot Mar 10, 2020
a5d9066
Do not try to load non-existent images
silviot Mar 10, 2020
57922bc
Update badges to new pipeline and fix script in docker cache setup step
silviot Mar 10, 2020
02d3b41
We need to create the cache directory in case of cachee miss
silviot Mar 10, 2020
d07d105
Bump version: 0.0.12 → 0.0.13
silviot Mar 10, 2020
d180e93
Add a restoreKeys parameter to images cache: we get speedups from pre…
silviot Mar 10, 2020
042c385
Better output in case of mysql query failure
silviot Mar 10, 2020
34b907a
Try to save/restore more images to get most out of the image cache
silviot Mar 10, 2020
a6feddb
Enable dev versions
silviot Mar 10, 2020
978c0bd
Bump version: 0.0.13+dev1 → 0.0.14+dev1
silviot Mar 10, 2020
34f74a3
Bump version: 0.0.14+dev1 → 0.0.15
silviot Mar 10, 2020
edbd4db
Do not use local version format
silviot Mar 10, 2020
3e475be
Bump version: 0.0.15 → 0.0.15.dev1
silviot Mar 10, 2020
e0b949e
Bump version: 0.0.15.dev1 → 0.0.15.dev2
silviot Mar 10, 2020
785475d
Allow nostatic-dev as target to derex build
silviot Mar 10, 2020
03a171f
Bump version: 0.0.15.dev2 → 0.0.15.dev3
silviot Mar 11, 2020
a4f2ea4
buildkit master has fixes we need
silviot Mar 11, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 14 additions & 9 deletions .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
[bumpversion]
current_version = 0.0.1
current_version = 0.0.15.dev3
commit = True
tag = True
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\.dev(?P<dev>\d+))?
serialize =
{major}.{minor}.{patch}.dev{dev}
{major}.{minor}.{patch}
commit-args = --no-verify

[bumpversion:file:setup.py]
search = version='{current_version}'
replace = version='{new_version}'

[bumpversion:file:docs/conf.py]
search = version = release = '{current_version}'
replace = version = release = '{new_version}'
search = version\="{current_version}"
replace = {new_version}

[bumpversion:file:derex/runner/__init__.py]
search = __version__ = '{current_version}'
replace = __version__ = '{new_version}'
search = __version__ \= "{current_version}"
replace = {new_version}

[bumpversion:file:docker-definition/Dockerfile]
search = ENV DEREX_VERSION\='{current_version}'
replace = {new_version}
2 changes: 2 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
layout_python python3.7

export DEREX_ADMIN_SERVICES=true
export DOCKER_BUILDKIT=1
export DOCKER_CLI_EXPERIMENTAL=enabled
2 changes: 2 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ repos:
rev: v2.4.0
hooks:
- id: trailing-whitespace
exclude: .bumpversion.cfg
- id: debug-statements
- id: check-added-large-files
- id: end-of-file-fixer
exclude: .bumpversion.cfg
- id: check-yaml
- id: flake8

Expand Down
21 changes: 5 additions & 16 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,9 @@ Report Bugs
Report bugs at
https://github.com/Abstract-Tech/derex.runner/issues.

If possible, provide a minimal derex project to trigger the bug.
Please provide a minimal derex project and instructions to trigger the bug.


Submit Feedback
~~~~~~~~~~~~~~~

The best way to send feedback is to file an issue at
https://github.com/Abstract-Tech/derex.runner/issues.

If you are proposing a feature:

* Explain in detail how it would work.
* Keep the scope as narrow as possible, to make it easier to implement.
* Remember that this is a volunteer-driven project, and that contributions
are welcome :)

Get Started!
------------

Expand Down Expand Up @@ -73,7 +60,9 @@ local development.
$ git commit -m "Your detailed description of your changes."
$ git push origin name-of-your-bugfix-or-feature

7. Submit a pull request through the GitHub website.
8. Create an azure pipeline to run your tests and make sure you keep it green.

9. When everything is green submit a pull request through the GitHub website.

Pull Request Guidelines
-----------------------
Expand All @@ -93,6 +82,6 @@ A reminder for the maintainers on how to deploy.
Make sure all your changes are committed (including an entry in HISTORY.rst).
Then run::

$ bumpversion patch # possible: major / minor / patch
$ bump2version patch # possible: major / minor / patch
$ git push
$ git push --tags
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ recursive-include derex/runner/templates *
recursive-include derex/runner/compose_files *
recursive-include derex/runner/fixtures *
recursive-include derex/runner/settings * *.py
recursive-include docker-definition *
recursive-include tests *
recursive-exclude * __pycache__
recursive-exclude * *.py[co]
Expand Down
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ Manage Open edX projects


.. image:: https://img.shields.io/azure-devops/tests/abstract-technology/derex.runner/5/master?compact_message&style=for-the-badge
:target: https://dev.azure.com/abstract-technology/derex.runner/_build
:target: https://dev.azure.com/abstract-technology/derex/_build?definitionId=12&_a=summary&repositoryFilter=12&branchFilter=198
:alt: Test results

.. image:: https://img.shields.io/azure-devops/coverage/abstract-technology/derex.runner/5/master?style=for-the-badge
:target: https://dev.azure.com/abstract-technology/derex.runner/_build
:target: https://dev.azure.com/abstract-technology/derex/_build?definitionId=12&_a=summary&repositoryFilter=12&branchFilter=198
:alt: Coverage results

Introduction
Expand Down
266 changes: 26 additions & 240 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,243 +6,29 @@ schedules:
- master
always: true

jobs:
- job: RunPytests
timeoutInMinutes: 40
pool:
vmImage: 'ubuntu-latest'
steps:
- template: azure-pipelines/prepare.yml

- script: |
set -ex
set -o pipefail
cd tests
pytest -m "not slowtest" --ignore-docstrings |grep -v codecoveragetool=Cobertura
displayName: 'Run python tests'

- publish: $(System.DefaultWorkingDirectory)/tests/.coverage
artifact: fasttests_coverage


- job: RunSlowPytests
timeoutInMinutes: 40
pool:
vmImage: 'ubuntu-latest'
steps:
- template: azure-pipelines/prepare.yml

- script: ddc-services pull
displayName: 'Pull edX services images'

- script: |
set -ex
export DEREX_ADMIN_SERVICES=False
ddc-services up -d
derex reset-mailslurper
displayName: 'Start service daemons'

- script: |
# Slow tests do not currently contribute to coverage
set -ex
set -o pipefail
cd tests
pytest -m "slowtest" --ignore-docstrings |grep -v codecoveragetool=Cobertura
displayName: 'Run python tests'

- publish: $(System.DefaultWorkingDirectory)/tests/.coverage
artifact: slowtests_coverage

- job: CombineCoverage
dependsOn:
- RunPytests
- RunSlowPytests
pool:
vmImage: 'ubuntu-latest'
steps:
- template: azure-pipelines/prepare.yml

- download: current

- task: Cache@2
inputs:
key: npmcache2
path: $(Pipeline.Workspace)/.cache/npm
displayName: Cache npm packages

- script: |
set -ex
cp $(Pipeline.Workspace)/slowtests_coverage/.coverage tests/.coverage.slow
cp $(Pipeline.Workspace)/fasttests_coverage/.coverage tests/.coverage.fast
cd tests
coverage combine
coverage html
coverage xml
cd ..
# We installed the package with pip, and coverage reports the full absolute path.
# We cut to derex/runner/etc/etc
DEREX_RUNNER_PATH=`cd tests;python -c "from pathlib import Path; import derex.runner;print(Path(derex.runner.__file__).parent.parent.parent)"`
echo Replacing ${DEREX_RUNNER_PATH} in tests/htmlcov/*.html
sudo npm config set cache $(Pipeline.Workspace)/.cache/npm --global
npm install juice
# Azure pipelines strips style sheets but leaves styles in place.
# juice can embed the styles in the HTML for us and present a much better
# view in the coverage results tab.
for filename in tests/htmlcov/*.html; do $(npm bin)/juice $filename $filename; done
echo "##vso[codecoverage.publish codecoveragetool=Cobertura;summaryfile=${PWD}/tests/coverage.xml;reportdirectory=${PWD}/tests/htmlcov;]"
displayName: Fix coverage result and publish it
condition: succeededOrFailed()


- job: TestComplete
timeoutInMinutes: 40
pool:
vmImage: 'ubuntu-latest'
steps:
- template: azure-pipelines/prepare.yml

- script: ddc-services pull
displayName: 'Pull edX services images'

- script: |
set -ex
export DEREX_ADMIN_SERVICES=False
ddc-services up -d
derex reset-mailslurper
displayName: 'Start service daemons'

- script: |
set -ex
cd tests/fixtures/complete
derex reset-mysql
derex reset-rabbitmq
ddc-services exec -T mysql mysql -h localhost --protocol tcp -u root -psecret complete_myedx -e "SELECT * from auth_user WHERE username='derex.runner'"|grep derex.runner
displayName: 'Test complete project fixtures'

- script: |
set -ex
cd tests/fixtures/complete
derex build-final
displayName: 'Build image for project "complete"'

- script: cd tests/fixtures/complete; ddc-project up -d
displayName: 'Start edX daemons'

- script: docker run --network derex -v $(pwd)/nginx.conf:/etc/nginx/conf.d/default.conf -p 80:80 -d --rm nginx:1.17.0-alpine
displayName: 'Start nginx to expose LMS/CMS on the same domain/port'

- script: |
echo 127.0.0.1 localhost studio.localhost | sudo tee -a /etc/hosts
sleep 3 # Give the services a little time to start up
displayName: Add studio.localhost to /etc/hosts

- script: |
cd tests/fixtures/complete; ddc-project logs cms lms
condition: always()
displayName: 'Show CMS/LMS logs'

- script: |
$CMD="curl --connect-timeout 30 --retry 5 --retry-delay 5 -f http://localhost:4700/"
$CMD || (sleep 10; $CMD )
displayName: 'Curl the LMS'

- script: |
$CMD="curl --connect-timeout 30 --retry 5 --retry-delay 5 -f http://localhost:4800/"
$CMD || (sleep 10; $CMD )
displayName: 'Curl the CMS'

- script: |
set -ex
cd tests/fixtures/complete
docker images
# This should not be needed, but for some reason Azure does not tag the image
docker tag $(docker images -q|head -n1) complete/openedx-themes
docker images

echo Installing dive
wget -q https://github.com/wagoodman/dive/releases/download/v0.8.0/dive_0.8.0_linux_amd64.deb
DEBIAN_FRONTEND=noninteractive sudo -E apt-get install -y ./dive_0.8.0_linux_amd64.deb
echo Analyzing image
dive --ci complete/openedx-themes
condition: always()
displayName: 'Test the complete image with dive'
continueOnError: true # Do not make the build fail because of this step, for now
timeoutInMinutes: 40

- script: |
derex runmode production
cd tests/fixtures/complete; derex build-themes; ddc-project up -d lms cms
sleep 5 # Give it time to start up
displayName: 'Start production image lms/cms'

- script: |
cd tests/fixtures/complete
ddc-project config
ddc-project logs cms lms
condition: always()
displayName: 'Show CMS/LMS final logs'

- script: |
$CMD="curl --connect-timeout 30 --retry 5 --retry-delay 5 -f http://localhost:4710/"
$CMD || (sleep 10; $CMD )
continueOnError: true # Temporarily disable this test: it's failing with this line in the logs:
# pymongo.errors.OperationFailure: command SON([('saslStart', 1), ('mechanism', 'SCRAM-SHA-1'), ('autoAuthorize', 1), ('payload', Binary(b'n,,n=edxapp,r=MDg3MjIwMjQyMDc4MTg3MjQ=', 0))]) on namespace complete_mongoedx.$cmd failed: Authentication failed.
displayName: 'Curl the final LMS'

- script: |
$CMD="curl --connect-timeout 30 --retry 5 --retry-delay 5 -f http://localhost:4810/"
$CMD || (sleep 10; $CMD )
continueOnError: true # Temporarily disable this test: it's failing with the line mentioned above
displayName: 'Curl the final CMS'

- script: |
ddc-services logs
cd tests/fixtures/complete; ddc-project logs
condition: always()
displayName: 'Show logs'

- script: |
cd tests/fixtures/complete; ddc-project config
condition: always()
displayName: 'Show ddc-project config'


- job: TestMinimal
timeoutInMinutes: 40
pool:
vmImage: 'ubuntu-latest'
steps:
- template: azure-pipelines/prepare.yml

- script: ddc-services pull
displayName: 'Pull edX services images'

- script: |
set -ex
export DEREX_ADMIN_SERVICES=False
ddc-services up -d
derex reset-mailslurper
displayName: 'Start service daemons'

- script: |
set -ex
cd tests/fixtures/minimal
ddc-project pull
displayName: 'Pull edx image'

- script: |
set -ex
cd tests/fixtures/minimal
derex reset-mysql
derex reset-rabbitmq
displayName: 'Prime Mysql DB'


- job: CheckDocs
timeoutInMinutes: 40
pool:
vmImage: 'ubuntu-latest'
steps:
- template: azure-pipelines/prepare.yml
- script: make docs
displayName: 'Compile docs'
stages:
- template: azure-pipelines/build.yml
- template: azure-pipelines/test.yml
- template: azure-pipelines/push.yml

variables:
- name: DOCKER_BUILDKIT
value: '1'
- name: DOCKER_CLI_EXPERIMENTAL
value: enabled
- name: DOCKER_COMMAND
value: docker buildx build docker-definition
- name: CACHE_KEY_BASE # Increment this value to reset the images cache
value: 21
- name: CACHE_KEY_FILES
value: $(System.DefaultWorkingDirectory)/docker-definition/*
- name: CACHE_KEY_IMAGES
value: BASE_SEED=$(CACHE_KEY_BASE) | $(CACHE_KEY_FILES)
- name: CACHE_KEY_IMAGES_FALLBACK
value: BASE_SEED=$(CACHE_KEY_BASE)
- name: SENTINEL_CACHE_PATH
value: $(Pipeline.Workspace)/sentinel_cache
- name: IMAGE_CACHE_PATH
value: $(Pipeline.Workspace)/image_cache
- name: needs_build
value: "false"
Loading