Commit b9ee1a5f authored by Yori Fournier's avatar Yori Fournier
Browse files

first commit

parent 4482e6f3
Pipeline #1905 failed with stages
image: openshift/origin-cli
default:
tags:
- debian
timeout: 1h 00m
stages:
- test
- build
- deploy
variables:
OPENSHIFT_SERVER: https://${OPENSHIFT_IP}:${OPENSHIFT_PORT}/
OPENSHIFT_DOMAIN: apps.okd.aip.de
# Configure this variable in Secure Variables:
#OPENSHIFT_TOKEN:
#OPENSHIFT_PROJECT: python
.login_to_okd: &login_to_okd
- oc login "$OPENSHIFT_SERVER" --token="$OPENSHIFT_TOKEN" --insecure-skip-tls-verify
- oc project "$CI_PROJECT_NAME-$CI_PROJECT_ID" 2> /dev/null || oc new-project "$CI_PROJECT_NAME-$CI_PROJECT_ID"
.build_image: &build_image
- "oc start-build $APP --from-file=$DOCKER_FILE --follow || sleep 3s && oc start-build $APP --from-file=$DOCKER_FILE --follow"
build-proc1:
stage: build
variables:
APP: proc1
DOCKER_FILE: dockerfile_proc1
APP_HOST: $CI_PROJECT_NAME-$CI_ENVIRONMENT_SLUG.$OPENSHIFT_DOMAIN
before_script:
- *login_to_okd
script:
- *build_image
build-proc2:
stage: build
variables:
APP: proc2
DOCKER_FILE: dockerfile_proc2
APP_HOST: $CI_PROJECT_NAME-$CI_ENVIRONMENT_SLUG.$OPENSHIFT_DOMAIN
before_script:
- *login_to_okd
script:
- *build_image
test1:
stage: test
before_script: []
script:
- echo run tests
test2:
stage: test
before_script: []
script:
- echo run tests
deploy:
stage: deploy
before_script:
- *login_to_okd
script:
- oc apply -f manifest.yaml
import pyvo as vo
import sunpy as sp
while True:
sleep(10.)
exit(0)
# base image
FROM python:3.7
#Upgrade pip
RUN pip install --upgrade pip
# copy over and install packages
COPY requirements.txt /tmp
RUN pip install -r /tmp/requirements.txt
# create non-root user
ARG UNAME=stuser
ARG UID=1000
ARG GID=1000
RUN groupadd -g $GID -o $UNAME
RUN useradd -m -u $UID -g $GID -o -s /bin/bash $UNAME
RUN mkdir -p /home/${UNAME}
RUN chown -R ${UID}:${GID} /home/${UNAME}
USER ${UID}:${GID}
WORKDIR /home/${UNAME}
# exposing default port for streamlit
EXPOSE 8501
# copying everything over
COPY . .
# run app
CMD python3 busybox.py
# base image
FROM python:3.7
#Upgrade pip
RUN pip install --upgrade pip
# copy over and install packages
COPY requirements.txt /tmp
RUN pip install -r /tmp/requirements.txt
# create non-root user
ARG UNAME=stuser
ARG UID=1000
ARG GID=1000
RUN groupadd -g $GID -o $UNAME
RUN useradd -m -u $UID -g $GID -o -s /bin/bash $UNAME
RUN mkdir -p /home/${UNAME}
RUN chown -R ${UID}:${GID} /home/${UNAME}
USER ${UID}:${GID}
WORKDIR /home/${UNAME}
# exposing default port for streamlit
EXPOSE 8502
# copying everything over
COPY . .
# run app
CMD python3 busybox.py
apiVersion: apps/v1
kind: Deployment
metadata:
name: pod-proc1
labels:
app: proc1
spec:
replicas: 1
selector:
matchLabels:
app: proc1
template:
metadata:
labels:
app: proc1
spec:
containers:
- name: proc1
image: proc1
ports:
- containerPort: 8051
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: pod-proc2
labels:
app: proc2
spec:
replicas: 1
selector:
matchLabels:
app: proc2
template:
metadata:
labels:
app: proc2
spec:
containers:
- name: proc2
image: proc2
ports:
- containerPort: 8052
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment