It seems that travis provisions a 64bit build machine by default when a integration process starts.
Is there any options that I can use in .travis.yml to request a 32bit Ubuntu build machine?
I really need 32bit OS, because the 64Bit Ubuntu refuse to install 32bit supporting libraries (ia32-libs).
The following packages have unmet dependencies:
ia32-libs : Depends: ia32-libs-multiarch
E: Unable to correct problems, you have held broken packages.
No, there is no such option (at least for now). See this issue: #986 travis_ci: Add 32-bit environments
#roidrage commented on 23 Jul 2015:
Closing this issue for now, as we have no immediate plans to add this feature.
Should we add it to the roadmap eventually, we'll make sure to update this ticket.
Travis supports a number of architectures using the arch: key. Unfortunately, none of these are 32-bit.
'shoogle' at https://github.com/travis-ci/travis-ci/issues/5770 suggests that it is possible to run a 32-bit image within a 64-bit container, by adding the following to .travis.yml:
services:
- docker
script:
- "docker run -i -v \"${PWD}:/MyProgram\" toopher/centos-i386:centos6 /bin/bash -c \"linux32 --32bit i386 /MyProgram/build.sh\""
And dlang suggest:
env:
- ARCH="x86_64"
matrix:
include:
- {os: linux, d: dmd-2.071.0, env: ARCH="x86", addons: {apt: {packages: [[gcc-multilib]]}}}
- {os: linux, d: ldc-1.0.0, env: ARCH="x86", addons: {apt: {packages: [[gcc-multilib]]}}}
script:
- dub test --arch "$ARCH"
Related
When I have a travis matrix build with a spec like this:
matrix:
include:
- os: osx
rust: stable
- os: linux
rust: stable
allow_failures:
- os: osx
and I use the deploy provider to upload an html book generated during the build:
deploy:
provider: pages
skip-cleanup: true
github-token: $GITHUB_PAGES_TOKEN
local-dir: target/html
keep-history: false
on:
branch: master
Which build output is that gh_pages provider running on?
From experimentation, it seems that the deploy: gh_pages provided is run on the last build in my matrix, in the example above: linux.
I am unsure if failure_allowed on the other builds (possibly combined with fast_fail) could change that though.
i.e.If the last one is allowed to fail (and it does) then I think the deployer will not run, even if overall the build has "succeeded" and is green.
I use matrix.include to trigger multiple test among diffrent os,the config is as follows:
matrix:
include:
- name: "build on linux"
os: linux
dist: trusty
sudo: required
services: docker
- name: "build on mac"
os: osx
osx_image: xcode10
env: CPPFLAGS=-I/usr/local/opt/openssl/include LDFLAGS=-L/usr/local/opt/openssl/lib
- name: "build on windows"
os: windows
I expected all the OS would run the build, but only the first triggered, the others was ignored for some reason.
The link of the config of the travis-ci is here.
I've found that travis's jobs key tends to override matrix:includes.
Have you tried removing the jobs system to see if the matrix works?
A colleague of mine removed mysqli driver in one of our Dockerfile for PHP hosting and it causes problem. Luckily it is discovered in staging environment.
Is there any tools our there that does unit testing for docker images and if there are certain unavailability of an essential driver, fail it in the CI/CD pipeline?
Download the latest shaded dist from https://github.com/dgroup/docker-unittests/releases:
wget https://github.com/dgroup/docker-unittests/releases/download/s1.1.1/docker-unittests-app-1.1.1.jar
De fine an *.yml file with tests.
version: 1.1
setup:
- apt-get update
- apt-get install -y tree
tests:
- assume: java version is 1.9, Debian build
cmd: java -version
output:
contains:
- openjdk version "9.0.1"
- build 9.0.1+11-Debian
- assume: curl version is 7.xxx
cmd: curl --version
output:
startsWith: curl 7.
matches:
- "^curl\\s7.*\\n.*\\nProtocols.+ftps.+https.+telnet.*\\n.*\\n$"
contains:
- AsynchDNS IDN IPv6 Largefile GSS-API
- assume: Setup section installed `tree`
cmd: tree --version
output:
contains: ["Steve Baker", "Florian Sesser"]
Run tests for image
java -jar docker-unittests.jar -f image-tests.yml -i openjdk:9.0.1-11
https://i.stack.imgur.com/DSv72.png
More you can find in https://github.com/dgroup/docker-unittests.
Feel free to submit new issues/questions/etc.
Did you know about Google's tool for testing container images - container-structure-test?
This utility can be easily integrated in CI/CD pipeline as artifact check step.
I am using mosquitto as one of my project tool. After i successfully compile (make binary) mosquitto via source code and try to run mosquitto_sub/pub, its shows that
./mosquitto_sub: /usr/lib/i386-linux-gnu/libmosquitto.so.1: version `MOSQ_1.5' not found (required by ./mosquitto_sub)
while Mosquitto and Mosquitto_psswd is able is run without any problem. Besides, my mosquitto version is 1.5.
I have no idea about this problem.
Any Help appreciated .
It sounds like you have an earlier version of mosquitto installed and it's libraries are on the system path.
Make sure you have uninstalled any earlier versions of mosquitto installed on the machine.
Also make sure you have run make install as root in your build directory to copy the libraries to the correct locations
I had a similar issue building on rpi model B+ using GNU make 4.2.1 and cc (Raspbian 8.3.0-6+rpi1) 8.3.0
Error reported: ./mosquitto_sub: /usr/lib/i386-linux-gnu/libmosquitto.so.1: version `MOSQ_1.6' not found (required by ./mosquitto_sub)
Note: I left the existing distribution in place so that I could leverage off the systemd mosquitto.service that gets installed with the debian packages mosquitto and mosquitto-clients.
Resolution:
mkdir proj
git clone https://github.com/eclipse/mosquitto.conf
cd mosquitto
# my build failed on master branch, so I picked a tag that worked for me
git checkout -b 1.6.9 tags/1.6.9
make WITH_WEBSOCKETS=yes WITH_DOCS=yes WITH_SRV=yes
# overwrite the existing binaries
sudo make install
sudo ldconfig
# verify that the newly installed binaries have overwritten the originals.
mosquitto --help|grep -w 'mosquitto version'
mosquitto_pub --help|grep -w 'mosquitto_pub version'
mosquitto_sub --help|grep -w 'mosquitto_sub version'
I want to use apt to install some packages for the test, however, it fails due to that the sudo is disabled. I found the following in the test output:
Sudo, the FireFox addon, setuid and setgid have been disabled.
It seems that the output comes from this line in travic-ci, but setting paranoid_mode to false in .travis.yml does not work.
How to enable sudo access?
PS: I am using private repo.
EDIT: The following .travis.yml will fail due to sudo: must be setuid root when running sudo apt-get update -qq
language: python
python:
- "3.4"
before_install:
- sudo apt-get update -qq
script:
- nosetests
Setting sudo: true and/or paranoid_mode: false does not work.
Sudo access is turned off on our Docker based architecture, which will be used in two contexts:
repositories opt in using sudo: false in their .travis.yml file (it additionally needs to be turned on on our side)
on our educational program (see http://education.travis-ci.com)
Builds running on our Docker based architecture currently cannot be allowed sudo access due to certain security concerns in the LXC/Docker layer. We hope this will be fixed in the near future, but unfortunately the issue is out of our own hands.
We are also working on improving the Firefox addon, which currently uses sudo itself, but shouldn't. We'll post on our blog once this has happened.
To extend the existing answer, if you put in .travis.yml:
sudo: required
Travis should switch your build to use their "standard infrastructure" (rather than their "container based infrastructure") and then you can use sudo.
References:
https://docs.travis-ci.com/user/workers/standard-infrastructure
https://docs.travis-ci.com/user/workers/container-based-infrastructure/
Nov 2018 Update
It seems that container-based infrastructure is getting deprecated. From the docs:
Container-based infrastructure is currently being deprecated. Please
use the fully-virtualized infrastrstructure via sudo: required
instead.
As explained in "Combining The Linux Infrastructures"
Going forward, we will slowly transition the container-based environment out, in favor of a build environment that is entirely virtual machine-based.
Folks using container-based infrastructures will be the only ones affected, and this transition will roll out slowly, depending on whether you specify sudo: false in your .travis.yml.
This is illustrated in Git 2.20 (Q4 2018), with:
Travis CI will soon deprecate the container-based infrastructure enabled by sudo: false in ce59dff (Git 2.8.0, Jan. 2016).
See commit 0f0c511 (01 Nov 2018) by SZEDER Gábor (szeder).
(Merged by Junio C Hamano -- gitster -- in commit 57f06d5, 13 Nov 2018)
travis-ci: install packages in 'ci/install-dependencies.sh'
Ever since we started using Travis CI, we specified the list of packages to install in '.travis.yml' via the APT addon.
While running our builds on Travis CI's container-based infrastructure we didn't have another choice, because that environment didn't support 'sudo', and thus we didn't have permission to install packages ourselves.
With the switch to the VM-based infrastructure in the previous patch we do get a working 'sudo', so we can install packages by running 'sudo apt-get -y install ...' as well.
Let's make use of this and install necessary packages in 'ci/install-dependencies.sh', so all the dependencies (i.e. both packages and "non-packages" (P4 and Git-LFS)) are handled in the same file.
Install gcc-8 only in the 'linux-gcc' build job; so far it has been unnecessarily installed in the 'linux-clang' build job as well.
Print the versions of P4 and Git-LFS conditionally, i.e. only when they have been installed; with this change even the static analysis and documentation build jobs start using 'ci/install-dependencies.sh'
to install packages, and neither of these two build jobs depend on and
thus install those.
This change will presumably be beneficial for the upcoming Azure Pipelines integration preliminary versions of that patch series run a couple of 'apt-get' commands to install the necessary packages before running 'ci/install-dependencies.sh', but with this patch it will be sufficient to run only 'ci/install-dependencies.sh'.