how to build centos 8 singularity container from recipe - centos8

tried:
BootStrap: yum
MirrorURL: http://mirror.centos.org/centos-8/8.3.2011/centosplus/x86_64/os/
Include: yum
singularity build --sandbox centos8 centos8.def
INFO: Starting build...
INFO: Skipping GPG Key Import
Error: Nothing to do
FATAL: While performing build: conveyor failed to get: while bootstrapping: exit status 1
no idea what the problem is
Thanks!

If you don't need to use yum as the bootstrap, you can easily build it from docker
sudo singularity build --sandbox centos8.sif docker://centos:8.3.2011
You do not need docker installed to use it as a bootstrap method, it just tells singularity to pull the blobs from docker hub rather than building them itself.

Related

Installing pandas with dockerfile for ARM/V7 architecture gets stuck

I want to build a Docker Image based on a Python 3.8 Image and then install some requirements including Pandas on a ARM/V7 platform. But when it comes to install the pip requirements the process gets stuck.
Is there any way to use a different base image or change something else in the Docker file to run pandas in a Docker image on a device with ARM/V7 architecture?
Here is the dockerfile:
FROM python:3.8#sha256:45fbccbc4681e8d9ef517d43f9d0eb8f17b2beac00b0f9697bbf85354ae8a266
WORKDIR /app
EXPOSE 8002/tcp
COPY requirements.txt requirements.txt
RUN pip install -r requirements.txt
COPY . .
CMD ["python3", "-m", "monitoring"]
The requirements.txt:
pandas==1.3.3
requests==2.26.0
When i am building the Image with docker build -t rfu . i get the following output:
Sending build context to Docker daemon 25.6kB
Step 1/7 : FROM python:3.8#sha256:45fbccbc4681e8d9ef517d43f9d0eb8f17b2beac00b0f9697bbf85354ae8a266
---> 0c665e140292
Step 2/7 : WORKDIR /app
---> Running in a5e6772c20f9
Removing intermediate container a5e6772c20f9
---> 5e7807e6f975
Step 3/7 : EXPOSE 8002/tcp
---> Running in d9f6cdc8aca1
Removing intermediate container d9f6cdc8aca1
---> bcd057ff5d87
Step 4/7 : COPY requirements.txt requirements.txt
---> d11ccce85d46
Step 5/7 : RUN pip install -r requirements.txt
---> Running in cd920fa4c18d
Collecting pandas==1.3.3
Downloading pandas-1.3.3.tar.gz (4.7 MB)
Installing build dependencies: started
Installing build dependencies: still running...
Installing build dependencies: still running...
Installing build dependencies: still running...
Installing build dependencies: still running...
Installing build dependencies: still running...
This is where the process get stuck.
I guess it takes time for compiling... Just use precompiled packages from https://piwheels.org/
RUN pip install --index-url=https://www.piwheels.org/simple --no-cache-dir -r requirements.txt

building singularity image for python script in centOS linux

I am trying to build singularity image in centOS linux. to do so I have make the following Singularity.recipe:
Bootstrap: yum
OSVersion: 7
MirrorURL: http://mirror.centos.org/centos-%{OSVERSION}/%{OSVERSION}/os/x86_64/
Include: yum
%post
yum -y install epel-release
yum -y install python34
%file
QC.py /
%runscript
python3 /QC.py
and then I used this command to build the image:
sudo singularity build test.simg Singularity.recipe
but I gave this error:
FATAL: Unable to build from Singularity.recipe: while parsing definition: Singularity.recipe: invalid section(s) specified: file
do you know how to solve the problem?
As the error message says, %file is not a valid section name. The correct section name is %files.

I am not able to install package using my hosted repository

yum -d0 -e0 -y --disablerepo\=\* --enablerepo\=my-repo-name install ksh-20120801-34.el7
gives:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
Error downloading packages:
ksh-20120801-34.el7.x86_64: [Errno 256] No more mirrors to try.
though "ksh-20120801-34.el7" is available in the repo I am getting the above error.
I have tried cleaning up, disabling and enabling of repo but still no luck . Any help on this could be much appreciated.
One step to debug it would be to list the repo and see what is on the list:
# yum --disablerepo=* --enablerepo=my-repo-name list | grep ksh
You can also try without 20120801-34.el7 suffix. So the command would be the following:
yum -d0 -e0 -y --disablerepo=* --enablerepo=my-repo-name install ksh
[root#ms-node0101 ~]# yum install -y ksh.el7
Loaded plugins: product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
No package ksh.el7 available.
Error: Nothing to do
[root#ms-node0101 ~]# yum install ksh-20120801-139
Loaded plugins: product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
No package ksh-20120801-139 available.
Error: Nothing to do
[root#ms-node0101 ~]# yum install -y ksh
Loaded plugins: product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
Resolving Dependencies
--> Running transaction check
---> Package ksh.x86_64 0:20120801-139.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=============================================================================================================================================================================================================================================
Package Arch Version Repository Size
=============================================================================================================================================================================================================================================
Installing:
ksh x86_64 20120801-139.el7 Local-Base 885 k
Transaction Summary
=============================================================================================================================================================================================================================================
Install 1 Package
Total download size: 885 k
Installed size: 3.1 M
Downloading packages:
ksh-20120801-139.el7.x86_64.rpm | 885 kB 00:00:01
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : ksh-20120801-139.el7.x86_64 1/1
Verifying : ksh-20120801-139.el7.x86_64 1/1
Installed:
ksh.x86_64 0:20120801-139.el7
Complete!
Thanks everyone for trying to help me out here. In my case solution was simple and debug goes like below.
Was trying to wget the package from the repo. Though connection was successful i was not able to download the package.
2 . My team-mate analysed the mounts in the repo and we got to know that they were not mounted properly so he remounted filesystems and post that i was able to download and it solved the install step as well.

creating docker file to run selenium Javascript based tests

I am trying to create a docker file to run selenium tests for a java script based project. Below is my docker file so far:
#base image
FROM selenium/standalone-chrome
#access to the project within docker container - Bundle app source
COPY ./seleniumTest/project /app
# Install Node.js
RUN sudo apt-get update
RUN sudo apt-get install --yes curl
RUN curl --silent --location https://deb.nodesource.com/setup_8.x | sudo bash -
#binding
EXPOSE 8080
#Define runtime
ENTRYPOINT /app/login.test.js
while building and running the docker image as: $ docker run -p 4000:8080 dockertest2 returns /bin/sh: 1: /app/login.test.js: Permission denied
why is the permission denied for it? P.S: I have changed to the dir which contains both Dockerfile and automation test JS files using (cd dir).
Create a Docker Container with all the dependencies needed for you app to run
Which can be specified in the DockerFile.
Attached a script at Entry point to Start Selenium Server Standalone.
Build and Run your Container and Remember to Bind and Expose the port your selenium is running

SShpass not allowed with Travis CI

Context
I have an application in which, I m using unit tests and I need to continuous deliver this. I chose to use github + travis + docker.
My Docker container is an Ubuntu 12.04 with openSSL that I cant connect from outside, and I dont have any problem with this
I need, when the travis build is okay, to connect my docker container via SSH and to run a script.
Problem
Actually, I m using :
But this doesn't work at all, because sshpass is not in the whitelist. It seems that I cant you before_install command, because I m on a container based infrastructure.
NB : The port is 22, I missed it during the picture taken.
Questions
How can I do to connect my ssh container from travis to deploy my app (only run a script that git clone / git pull if the directory exists)
Is this a good way to make it like this with travis, or does it exist something else ?
EDIT :
The travis new file :
And the log
Using worker: worker-linux-968a87ce-1.bb.travis-ci.org:travis-linux-14
system_info
Build system information
Build language: node_js
Build image provisioning date and time
Wed Feb 4 18:22:50 UTC 2015
Operating System Details
Distributor ID: Ubuntu
Description: Ubuntu 12.04 LTS
Release: 12.04
Codename: precise
Linux Version
2.6.32-042stab090.5
Cookbooks Version
23bb455 https://github.com/travis-ci/travis-cookbooks/tree/23bb455
GCC version
gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
LLVM version
clang version 3.4 (tags/RELEASE_34/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix
Pre-installed Ruby versions
ruby-1.9.3-p551
Pre-installed Node.js versions
v0.10.36
Pre-installed Go versions
1.4.1
Redis version
redis-server 2.8.19
riak version
2.0.2
MongoDB version
MongoDB 2.4.12
CouchDB version
couchdb 1.6.1
Neo4j version
1.9.4
Cassandra version
2.0.9
RabbitMQ Version
3.4.3
ElasticSearch version
1.4.0
Installed Sphinx versions
2.0.10
2.1.9
2.2.6
Default Sphinx version
2.2.6
Installed Firefox version
firefox 31.0esr
PhantomJS version
1.9.8
ant -version
Apache Ant(TM) version 1.8.2 compiled on December 3 2011
mvn -version
Apache Maven 3.2.5 (12a6b3acb947671f09b81f49094c53f426d8cea1; 2014-12-14T17:29:23+00:00)
Maven home: /usr/local/maven
Java version: 1.7.0_76, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-7-oracle/jre
Default locale: en, platform encoding: UTF-8
OS name: "linux", version: "2.6.32-042stab090.5", arch: "amd64", family: "unix"
git.checkout
0.26s$ git clone --depth=50 --branch=master git://myPrivateRepo/Project
Cloning into 'user/Project'...
remote: Counting objects: 1363, done.
remote: Compressing objects: 100% (9/9), done.
remote: Total 1363 (delta 4), reused 0 (delta 0), pack-reused 1354
Receiving objects: 100% (1363/1363), 874.89 KiB | 0 bytes/s, done.
Resolving deltas: 100% (263/263), done.
Checking connectivity... done.
$ cd user/Project
$ git checkout -qf commitId
1.56s$ nvm install 0.10
######################################################################## 100.0%
Now using node v0.10.38
$ node --version
v0.10.38
$ npm --version
1.4.28
$ nvm --version
0.23.3
before_install
6.72s$ sudo apt-get install sshpass
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
libgeos-3.2.2
Use 'apt-get autoremove' to remove them.
The following NEW packages will be installed:
sshpass
0 upgraded, 1 newly installed, 0 to remove and 102 not upgraded.
Need to get 10.5 kB of archives.
After this operation, 56.3 kB of additional disk space will be used.
Get:1 http://us.archive.ubuntu.com/ubuntu/ precise/universe sshpass amd64 1.05-1 [10.5 kB]
Fetched 10.5 kB in 0s (234 kB/s)
Selecting previously unselected package sshpass.
(Reading database ... 75363 files and directories currently installed.)
Unpacking sshpass (from .../sshpass_1.05-1_amd64.deb) ...
Processing triggers for man-db ...
Setting up sshpass (1.05-1) ...
install
1.12s$ npm install
npm WARN package.json UnitTest#0.0.0 No description
npm WARN package.json UnitTest#0.0.0 No repository field.
npm WARN package.json UnitTest#0.0.0 No README data
0.95s$ npm test
> UnitTest#0.0.0 test /home/travis/build/user/project
> node test
First test should fail: 1) First test should fail
0 passing (8ms)
1 failing
1) First test should fail:
AssertionError: true == false
+ expected - actual
-true
+false
at Context.<anonymous> (test/first.js:8:16)
The command "npm test" exited with 0.
after_success
0.91s$ sudo sshpass -p password ssh root#ip -p 7000
Done. Your build exited with 0.
sshpass can be installed in a Travis CI container by adding:
addons:
apt:
packages:
- sshpass
I see two possible solutions to your problem:
Switch to the non-container based infrastructure of Travis-CI, by adding sudo: true in your .travis file, so you will be able to install the package you need.
Ask for the addition of sshpass in the package white list. Request can be done here: https://github.com/travis-ci/travis-ci/labels/apt-whitelist
Can you use an SSH key instead of sshpass? That way you can simply use the SSH key to connect to the Docker container instead of using a password.