Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
No results found
Show changes
Commits on Source (47)
......@@ -5,3 +5,5 @@
__pycache__/
*.so
*.e
public/
archive/
stages:
- build
- test
- release
variables:
CONTAINER_TEST_IMAGE: boileaum/rosen:$CI_COMMIT_REF_NAME
CONTAINER_RELEASE_IMAGE: boileaum/rosen:latest
before_script:
- echo $DOCKERHUB_PASSWD | docker login -u boileaum --password-stdin
b:docker:
stage: build
tags:
- shell, docker
script:
- docker build --pull -t $CONTAINER_TEST_IMAGE -f ./docker/Dockerfile-rosen .
- docker push $CONTAINER_TEST_IMAGE
t:helloworld:
stage: test
tags:
- shell, docker
script:
- docker pull $CONTAINER_TEST_IMAGE
- docker run $CONTAINER_TEST_IMAGE /bin/bash -c 'python test_helloworld.py'
t:rosen:
stage: test
tags:
- shell, docker
script:
- docker pull $CONTAINER_TEST_IMAGE
- docker run $CONTAINER_TEST_IMAGE /bin/bash -c 'pytest -v'
r:docker:
stage: release
tags:
- shell, docker
script:
- docker pull $CONTAINER_TEST_IMAGE
- docker tag $CONTAINER_TEST_IMAGE $CONTAINER_RELEASE_IMAGE
- docker push $CONTAINER_RELEASE_IMAGE
pages:
tags:
- docker-exec
- tp-gitlab-ci
image: jupyter/minimal-notebook
script:
- mkdir public
- ./scripts/make_slides.sh
- ./scripts/make_archive.sh
artifacts:
paths:
- public
only:
- master
https://creativecommons.org/licenses/by-sa/4.0
\ No newline at end of file
# TP GitLab CI
## Execution du notebook jupyter
Le contenu de cette session pratique est publié sur cette [page](https://xstra-dev.pages.unistra.fr/tp-gitlab-ci/).
### Execution du notebook jupyter
- [Installer Anaconda](https://www.anaconda.com/download) pour disposer de `jupyter-notebook`
- Ajouter le support du noyau bash :
......
FROM python:3
MAINTAINER Matthieu Boileau <matthieu.boileau@math.unistra.fr>
COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt
RUN apt-get update --fix-missing && \
apt-get install -y \
vim
RUN apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN useradd -m -s /bin/bash euler
ENV HOME /home/euler
RUN chown -R euler:euler /home/euler
USER euler
WORKDIR $HOME
CMD /bin/bash
FROM boileaum/pythran:latest
MAINTAINER Matthieu Boileau <matthieu.boileau@math.unistra.fr>
ENV HOME /home/euler
ADD . $HOME/rosen
USER root
RUN chown -R euler:euler /home/euler
WORKDIR $HOME/rosen
USER euler
RUN make clean && make
CMD /bin/bash
version: '2'
services:
env:
build:
context: ../
dockerfile: docker/Dockerfile-pythran
image: boileaum/pythran:latest
user:
build:
context: ../
dockerfile: docker/Dockerfile-rosen
image: boileaum/rosen:latest
depends_on:
- env
#include <stdio.h>
int main(void)
{
printf("hello, world\n");
return 0;
}
File moved
images/git_repo_by_url.png

9.58 KiB

images/pipeline.png

24.9 KiB

File moved
%% Cell type:markdown id: tags:
### Journée X/Stra-Dev Intégration continue
21 novembre 2017
---
# L'intégration continue avec GitLab
![image.png](images/tanuki.png)
## *Session pratique*
Le support de cette session est disponible en version :
- **notebook Jupyter** exécutable :
- soit sous forme d'[archive](https://xstra-dev.pages.unistra.fr/tp-gitlab-ci/archive.tar.gz) téléchargeable
- soit sous forme de [dépôt git](https://git.unistra.fr/xstra-dev/tp-gitlab-ci) clonable
- [html](http://nbviewer.jupyter.org/urls/xstra-dev.pages.unistra.fr/tp-gitlab-ci/tp-gitlab-ci.ipynb) statique
- [diaporama](https://xstra-dev.pages.unistra.fr/tp-gitlab-ci/tp-gitlab-ci.slides.html) statique
> **Pour exécuter le notebook jupyter**
>
> - Télécharger l'[archive](https://xstra-dev.pages.unistra.fr/tp-gitlab-ci/archive.tar.gz) ou cloner le [dépôt](https://git.unistra.fr/xstra-dev/tp-gitlab-ci)
>
> - [Installer Anaconda](https://www.anaconda.com/download) pour obtenir `jupyter-notebook`
> - Ajouter le support du noyau bash :
>
> ```bash
> pip install bash_kernel
> python -m bash_kernel.install
> ```
>
> - Lancer le notebook :
>
> ```bash
> jupyter notebook tp-gitlab-ci.ipynb
> ```
---
Matthieu Boileau - <matthieu.boileau@math.unistra.fr>
*Contenu sous licence [CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0)*
.PHONY: clean pythran
all: C pythran
C:
gcc helloworld.c -o helloworld.e
pythran:
pythran rosenbrock.py -o rosenbrock_pythran.so
clean:
rm -rf *.o *.e *.so *.pyf *.pyc __pycache__
python -m bash_kernel.install
# -*- coding: utf-8 -*-
#runas import numpy as np; r = np.arange(0.,10., .01); rosen(r)
#bench import numpy as np; r = np.arange(50000000); rosen(r)
#pythran export rosen(int[])
#pythran export rosen(float[])
import numpy as np
def rosen(x):
t0 = 100 * (x[1:] - x[:-1] ** 2) ** 2
t1 = (1 - x[:-1]) ** 2
return np.sum(t0 + t1)
......@@ -2,4 +2,4 @@
set -x
nbfile="tp-gitlab-ci.ipynb"
jupyter-nbconvert $nbfile --to slides --post serve $2 --allow-errors
jupyter-nbconvert $nbfile --to slides --post serve --execute --allow-errors
#!/bin/bash
rm -rf archive
mkdir -p archive
cp tp-gitlab-ci.ipynb archive/
cp -r images archive/
cp -r videos archive/
tar cfvz archive.tar.gz archive
mkdir -p public
mv archive.tar.gz public/