How to install bazel4.2 on OpenSuse - opensuse

It seems OpenSuse provide bazel4.2 package, unfortunately it is an experimental/community package and I don't know how to enable this feed in my opensuse based Dockerfile.
Dockerfile:
FROM opensuse/tumbleweed
RUN zypper update -y \
&& zypper install -y bazel4.2
RUN bazel --version
Observed
docker build --tag=plop .
...
Retrieving repository 'openSUSE-Tumbleweed-Non-Oss' metadata [..done]
Building repository 'openSUSE-Tumbleweed-Non-Oss' cache [....done]
Retrieving repository 'openSUSE-Tumbleweed-Oss' metadata [......done]
Building repository 'openSUSE-Tumbleweed-Oss' cache [....done]
Retrieving repository 'openSUSE-Tumbleweed-Update' metadata [.done]
Building repository 'openSUSE-Tumbleweed-Update' cache [....done]
Loading repository data...
Reading installed packages...
Nothing to do.
Loading repository data...
Reading installed packages...
No provider of 'bazel4.2' found.
'bazel4.2' not found in package names. Trying capabilities.
Expected
Bazel4.2 is retrieved and installed from one community/experimental repository.
ref: https://software.opensuse.org/package/bazel4.2

after few trial and error
Dockerfile:
FROM opensuse/tumbleweed
RUN zypper update -y
# https://en.opensuse.org/SDB:Add_package_repositories
RUN zypper ar -Gf https://download.opensuse.org/repositories/devel:tools:building/openSUSE_Factory/devel:tools:building.repo
# https://software.opensuse.org/package/bazel4.2
RUN zypper install -y bazel4.2
RUN bazel --version

Related

apt-get update in a dockerfile destroys app consistency?

In the dockerfiles I have seen, and the in the best practices for writing a docker file: https://docs.docker.com/engine/reference/builder/#copy, when apt-get is used to install some packages, apt-get update is always run first. I have a concern on this because the app we build in the corresponding docker container would depend on these installed packages, if there is some inconsistency in the newest version of the installed packages, the software we build will not work right any more. Why we do not specify a version of the packages, but use apt-get update instead?
From the man page for apt-get:
update is used to resynchronize the package index files from their
sources. The indexes
of available packages are fetched from the location(s) specified in
/etc/apt/sources.list. For example, when using a Debian archive, this command retrieves
and scans the Packages.gz files, so that information about new and updated packages is
available. An update should always be performed before an upgrade or dist-upgrade.
Please be aware that the overall progress meter will be incorrect as the size of the
package files cannot be known in advance.
You can try running apt-get install without running update on a docker image but you'll probably find that a lot of things will fail to install because the package indexes are out of date.
Once you update the package data, then you can specify a specific version for packages when you run install e.g.
apt update && apt install -y \
git=1:2.7.4-0ubuntu1.4
Example with docker container:
> sudo docker run -it ubuntu:16.04 /bin/bash
# root#513eb786d86d:/# apt install git
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package git
root#513eb786d86d:/# apt install git=1:2.7.4-0ubuntu1.4
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package git
root#513eb786d86d:/# apt update
...
root#513eb786d86d:/# apt install git=1:2.7.4-0ubuntu1.4
# works this time!

how to integrate cmake in gitlab repository for Continuous Integration(CI)

I was able to run the C++ Program and build & test it using GitLab CI unit with the help of Docker Image of gcc. But now I want to compile the program in docker using cmake instead of g++. How to change the '.gitlab-ci.yml' file to support cmake.
Current File : .gitlab-ci.yml
image: gcc
before_script:
- apt-get install --yes cmake libmatio-dev libblas-dev libsqlite3-dev libcurl4-openssl-dev
- apt-get install --yes libarchive-dev liblzma-dev
build:
script:
- ./runner.sh
- ./bin/hello
./runner.sh
cmake -H. -Bbuild
cmake --build build -- -j3
I think you need to add apt-get update in order to get cmake to install. See this
image: gcc
before_script:
- apt-get update --yes
- apt-get install --yes cmake
build:
script:
- ./runner.sh
- ./bin/hello
In general, you can figure stuff out by jumping into the docker image to debug (in your case the image is the debian-based gcc:latest):
sudo docker run -it --rm gcc
If you had run your original apt-get install command inside the gcc container, you would have seen following error message that you could have then googled to figure out that apt-get update was needed
sudo docker run -it --rm gcc apt-get install --yes cmake
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package cmake is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'cmake' has no installation candidate
As this blog post mentions, you can do a test run locally by downloading the gitlab-runner executable:
gitlab-runner exec docker build
Running the gitlab-runner locally will have gitlab clone your repo and run through all the steps in the .gitlab-ci.yml and you can see the output and debug locally rather quickly.

not able to install contextBroker via yum on CentOs7

HI everybody i am using CentOs7 and havae some troubles with the installation of the contextBroker. I followed the installation on the added the Fiware Repo in my yum repo.
Here is a list of my yum repo:
repo id repo name status
base/7/x86_64 CentOS-7 - Base 9,007
epel/x86_64 Extra Packages for Enterprise Linux 7 - x86_64 10,368
extras/7/x86_64 CentOS-7 - Extras 356
fiware Fiware Repository 176
mongodb MongoDB repo 279
updates/7/x86_64 CentOS-7 - Updates 2,070
repolist: 22,256
I am always getting an error message that there are some failed dependencies
libboost_filesystem-mt.so.5()(64bit) is needed by contextBroker-0.15.0-1.x86_64
libboost_system-mt.so.5()(64bit) is needed by contextBroker-0.15.0-1.x86_64
libboost_thread-mt.so.5()(64bit) is needed by contextBroker-0.15.0-1.x86_64
Here is the output of my config file for the fiware.repo
[fiware]
name=Fiware Repository
#baseurl=http://repositories.lab.fiware.org/repo/rpm/$releasever
baseurl=http://repositories.lab.fiware.org/repo/rpm/x86_64/
gpgcheck=0
enabled=1
I found a possible solution under this link, but unfortunately this is not working. In the comment section there is an entry which says that there is a problem with CentOs7 but that doesn`t solve my problem
Btw: this is also not working Boost-Libboost is needed in Centos7 (ContexBroker)
So my question is, did someone installed the contextBroker on CentOs7 via yum and if he/she did how can i solve this problem ?
As you mention, there isn't official support for CentOS 7 at the present moment. However, you could do the following to get a running binary with contextBroker in your CentOS 7 system (actually, this a "quick and dirty" receipt based on the build from sources procedure documented in the Orion manual):
sudo yum install git wget
wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
sudo rpm -i epel-release-latest-7.noarch.rpm
sudo yum install make cmake gcc-c++ scons
sudo yum install boost-devel libcurl-devel gnutls-devel libgcrypt-devel libuuid-devel
# Install mongoDB driver as described in the documentation
# Install rapidjson as described in the documentation
# Install libmicrohttpd as described in the documentation
mkdir ~/src
cd ~/src
git clone https://github.com/telefonicaid/fiware-orion.git
cd fiware-orion
# optionally, you can set an specific version with a checkout command
# e.g. 'git checkout 1.2.1'. Otherwise, you will build the latest
# code from develop branch
make
BUILD_RELEASE/src/app/contextBroker/contextBroker --version
Moreover, you can use the following to generate a RPM file:
sudo yum install rpm-build
make rpm
# The RPM is generated in rpm/RPMS/x86_64/contextBroker-1.2.0_next-dev.x86_64.rpm
# (version number may vary)
That RPM file is supposed to work in other CentOS 7 systems and you can install just using sudo yum install /path/to/contextBroker-1.2.0_next-dev.x86_64.rpm.

ebextensions: yum does not install package

I am trying to make an ebextensions file which will install wkhtmltopdf.
Currently it looks like this:
packages:
yum:
xorg-x11-fonts-75dpi: []
libpng: []
xz: []
urw-fonts: []
libXext: []
openssl-devel: []
libXrender: []
rpm:
wkhtmltopdf: https://s3-eu-west-1.amazonaws.com/myS3Account/wkhtmltox-0.12.2.1_linux-centos5-amd64.rpm
In this case, wkthmltopdf fails to install. I get the following error:
Failed dependencies:
xorg-x11-fonts-75dpi is needed by wkhtmltox-1:0.12.2.1-1.x86_64
If I use SSH to connect to my EC2 instance, I can sucessfully install wkhtml by manually running "yum install xorg-x11-fonts-75dpi", followed by "wget wkthmltopdf-..." and "rpm --install wkhtmltopdf-..". If I skip the yum step, rpm complains that wkhtmltopdf needs the xorg package.
It seems like xorg-x11-fonts-75dpi is not installed by ebextensions on deploy. Am I doing something wrong?
According to the docs:
Packages are processed in the following order: rpm, yum, and then rubygems and python.
Elastic beanstalk first processes your rpm package, causing the error and never gets to the yum packages.
There are a few ways to solve this.
1) Run the rpm install through a command like
commands:
install_wkhtmltox:
command: yum -y install https://s3-eu-west-1.amazonaws.com/myS3Account/wkhtmltox-0.12.2.1_linux-centos5-amd64.rpm
This should automatically solve dependencies through yum.
2) Split the .ebextensions files to two: 01_install_dependencies.config and 02_install_wkhtmltox.config. In the 01-file install yum packages, in the 02 file install the rpm. This way you can "override" the package installation order
http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/customize-containers-ec2.html#customize-containers-format-packages

yum update from wrong repository i

I am running a AWS Linux AMI in AWS, it seems to be RHEL under the covers and uses yum (kernel 3.4.62-53.42.amzn1.x86_64) . The amazon repo includes nginx 1.4.2 which is out of date so I removed it and re-installed using the repo given at nginx website. I did this as such:
sudo yum remove nginx*
sudo yum --disablerepo="*" --enablerepo="nginx" install nginx
Note that yum priorities are disabled. I tried messing around with setting priority= in the repo files but decided disabling priorities made sense after reading up on it.
/etc/yum.repos.d files :
amzn-main.repo contains:
[amzn-main]
name=amzn-main-Base
mirrorlist=http://repo.us-east-1.amazonaws.com/$releasever/main/mirror.list
mirror_expire=300
metadata_expire=300
priority=10
failovermethod=priority
fastestmirror_enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-amazon-ga
enabled=1
retries=5
timeout=10
report_instanceid=yes
[amzn-main-debuginfo]
name=amzn-main-debuginfo
mirrorlist=http://repo.us-east-1.amazonaws.com/$releasever/main/debuginfo/mirror.list
mirror_expire=300
metadata_expire=300
priority=10
failovermethod=priority
fastestmirror_enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-amazon-ga
enabled=0
retries=5
timeout=10
report_instanceid=yes
nginx.repo contains:
[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/rhel/6/$basearch/
gpgcheck=0
enabled=1
priority=1
Now doing the update once nginx 1.4.3 is installed, it tries to install the old version from the amazon main repo:
$ sudo yum update
Loaded plugins: update-motd, upgrade-helper
Resolving Dependencies
--> Running transaction check
---> Package nginx.x86_64 0:1.4.3-1.el6.ngx will be updated
---> Package nginx.x86_64 1:1.4.2-1.12.amzn1 will be an update
--> Finished Dependency Resolution
Dependencies Resolved
So not sure why its picking up the older version. Is there a way to configure yum to only update if the version is newer than currently installed? If there is no way, is there a way to skip nginx package when I do a general update and then update nginx using another command as described above that disables all repos and uses only nginx repo, here it is again:
sudo yum --disablerepo="*" --enablerepo="nginx" install nginx
To ignore any specific package in a single yum repository, one may add the following line to their /etc/yum.repos.d/${amazonreponame}.repo configuration file:
exclude=package_name*
Example:
[amzn-main]
name=amzn-main-Base
mirrorlist=http://repo.us-east-1.amazonaws.com/$releasever/main/mirror.list
mirror_expire=300
metadata_expire=300
priority=10
failovermethod=priority
fastestmirror_enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-amazon-ga
enabled=1
retries=5
timeout=10
report_instanceid=yes
exclude=nginx*
The exclude=* option may also be added globally (i.e., all repos) to /etc/yum.conf