Giter Club home page Giter Club logo

xrootd-openshift-test's Introduction

https://travis-ci.org/tiborsimko/xrootd-openshift-test.png https://img.shields.io/badge/licence-GPL_3-green.svg?style=flat

Testing XRootD container on OpenShift

Running locally

Firstly, on laptop, test using bare docker as follows:

$ docker build -t xrootd-openshift-test .
$ docker run --rm xrootd-openshift-test
OK

Secondly, on OpenShift, test as follows:

OpenShift tests

Using OpenShift build

Login to Openshift using CERN credentials:

$ oc login https://openshift.cern.ch

Create resources contained under openshift directory:

$ oc create -f openshift/xrootdpyfs-output-image.yaml
imagestream "xrootdpyfs" created
$ oc create -f openshift/xrootdpyfs-build.yaml
buildconfig "xrootdpyfs-build" created
$ oc create -f openshift/xrootdpyfs-deployment.yaml
deploymentconfig "xrootdpyfs" created

Once the resources are created, as if you were runing docker build . locally, run:

$ oc start-build xrootdpyfs-build --follow
build "xrootdpyfs-build-1" started
timed out getting logs, retrying
Cloning "https://github.com/tiborsimko/xrootd-openshift-test" ...
        Commit: aa9c71b821f2cd39f050af153272d5e483a94198 (docs: nicer README)
        Author: Tibor Simko <[email protected]>
        Date:   Tue Sep 19 18:18:55 2017 +0200
Pulling image docker.io/centos@sha256:822de5245dc5b659df56dd32795b08ae42db4cc901f3462fc509e91e97132dc0 ...
Pulled 0/1 layers, 7% complete
Pulled 1/1 layers, 100% complete
...

Finally, run the test case:

$ oc debug dc/xrootdpyfs
Debugging with pod/xrootdpyfs-debug, original command: /usr/bin/python /tmp/test.py
Waiting for pod to start ...
sh-4.2$ python /tmp/test.py
Segmentation fault # hopefully OK when fixed

Using locally built image

Building image locally and pushing to Dockerhub:

$ docker build . -t <dockerhub-username>/xrootd-openshift
$ docker push <dockerhub-username>/xrootd-openshift
# replace <dockerhub-username> with real one in
# `xrootdpyfs-from-dockerhub-deployment.yaml`
$ oc create -f openshift/xrootdpyfs-from-dockerhub-deployment.yaml
$ oc debug dc/xrootdpyfs-from-dockerhub
Debugging with pod/xrootdpyfs-from-dockerhub-debug, original command: /usr/bin/python /tmp/test.py
Waiting for pod to start ...
Pod IP: 10.76.22.243
If you don't see a command prompt, try pressing enter.
sh-4.2$ python /tmp/test.py
Segmentation fault

Building xrootd from sources

Replacing dockerfile name in xrootdpyfs-build.yaml for Dockerfile-building-xrootd-from-sources:

$ oc create -f openshift/xrootdpyfs-output-image.yaml
imagestream "xrootdpyfs" created
$ oc create -f openshift/xrootdpyfs-build.yaml
buildconfig "xrootdpyfs-build" created
$ oc create -f openshift/xrootdpyfs-deployment.yaml
deploymentconfig "xrootdpyfs" created
$ oc start-build xrootdpyfs-build --follow
$ oc debug dc/xrootdpyfs
Debugging with pod/xrootdpyfs-from-sources-debug, original command: /usr/bin/python /tmp/test.py
Waiting for pod to start ...
Pod IP: 10.76.8.146
If you don't see a command prompt, try pressing enter.
                                                    sh-4.2$
sh-4.2$ python /tmp/test.py
Segmentation fault

Running locally with random user

Build CentOS 7 image locally and run it:

$ docker build -t xrootd-openshift-test-centos7 . -f Dockerfile-centos7
$ docker run --rm --user 9999 xrootd-openshift-test-centos7 bash
bash-4.2$ python /tmp/test.py
Segmentation fault
bash-4.2$ python -c 'import xrootdpyfs'
Segmentation fault
bash-4.2$ python -c 'import XRootD.client'
Segmentation fault

Final fix: naming random user at run time

Following OpenShift docs, we will use uid_entrypoint script to name the user at run time. See Dockerfile-centos7-name-user-at-runtime:

$ docker build -t xrootd-openshift-test-centos7 . -f Dockerfile-centos7-name-user-at-runtime
$ docker run --rm --user 9999 xrootd-openshift-test-centos7 python /tmp/test.py
OK

xrootd-openshift-test's People

Contributors

tiborsimko avatar

Watchers

 avatar James Cloos avatar  avatar

Forkers

diegodelemos

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.