Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tiborsimko/xrootd-openshift-test
Testing XRootD Python client on OpenShift
https://github.com/tiborsimko/xrootd-openshift-test
Last synced: 17 days ago
JSON representation
Testing XRootD Python client on OpenShift
- Host: GitHub
- URL: https://github.com/tiborsimko/xrootd-openshift-test
- Owner: tiborsimko
- License: gpl-3.0
- Created: 2017-09-19T16:17:13.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-09-22T14:22:48.000Z (over 7 years ago)
- Last Synced: 2024-10-11T08:15:00.927Z (4 months ago)
- Language: Python
- Homepage:
- Size: 27.3 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- License: COPYING
Awesome Lists containing this project
README
.. image:: https://travis-ci.org/tiborsimko/xrootd-openshift-test.png
:target: https://travis-ci.org/tiborsimko/xrootd-openshift-test
.. image:: https://img.shields.io/badge/licence-GPL_3-green.svg?style=flat
:target: https://raw.githubusercontent.com/tiborsimko/xrootd-openshift-test/master/COPYINGTesting 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
OKSecondly, 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" createdOnce 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
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 fixedUsing locally built image
'''''''''''''''''''''''''Building image locally and pushing to Dockerhub::
$ docker build . -t /xrootd-openshift
$ docker push /xrootd-openshift
# replace 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 faultBuilding 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 faultRunning 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 faultFinal 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