Skip to content
Snippets Groups Projects
Commit 72271bb2 authored by Klaus Reuter's avatar Klaus Reuter
Browse files

retry educational example

parent d4484589
No related branches found
No related tags found
No related merge requests found
Pipeline #138134 failed
stages: # List of stages for jobs, and their order of execution test_python_numpy:
- build image: python:3.9
- test tags: - docker
- deploy cache:
key: "python39_pip_cache_20220731"
cache: &global_cache paths:
# key: $CI_COMMIT_REF_SLUG - .cache/pip
key: $CI_COMMIT_SHA variables:
paths: PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
- bin before_script:
policy: pull-push - pip install numpy==1.22.4
script:
build-job: # This job runs in the build stage, which runs first. - >
stage: build python -c
tags: "
- cloud import numpy as np
script: A = np.random.rand(32,32)
- echo "Compiling the code..." B = np.linalg.inv(A)
- echo "Compile complete." C = A @ B
- mkdir -p bin assert(np.allclose(C.diagonal(), np.ones(32)))
- cp /usr/bin/rev bin "
unit-test-job: # This job runs in the test stage.
stage: test # It only starts when the job in the build stage completes successfully.
tags:
- cloud-gpu
cache:
# inherit all global cache settings
<<: *global_cache
# override the policy
policy: pull
script:
- echo "Running unit tests... This will take about 60 seconds." | bin/rev
lint-test-job: # This job also runs in the test stage.
stage: test # It can run at the same time as unit-test-job (in parallel).
tags:
- cloud
cache:
# inherit all global cache settings
<<: *global_cache
# override the policy
policy: pull
script:
- echo "Linting code... This will take about 10 seconds." | bin/rev
deploy-job: # This job runs in the deploy stage.
stage: deploy # It only runs when *both* jobs in the test stage complete successfully.
tags:
- cloud
cache:
# inherit all global cache settings
<<: *global_cache
# override the policy
policy: pull
script:
- echo "Deploying application..."
- echo "Application successfully deployed." | bin/rev
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment