Skip to content

Commit

Permalink
Start all docker container with ulimit
Browse files Browse the repository at this point in the history
Change-Id: I247584dbe0d4d6dfb3c813debefb2cc3b9f8e9b7
  • Loading branch information
AZurhake committed Jun 14, 2019
1 parent ceadfe6 commit 907c7f5
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions buildscripts/scripts/build-nodes.jenkins
Expand Up @@ -10,7 +10,7 @@ currentBuild.description = 'Building for the following Distros:\n' + DISTRO_LIST
node {
docker.withRegistry(DOCKER_REGISTRY, 'nexus') {
docker.image('ubuntu-18.04-common').pull()
docker.image('ubuntu-18.04-common').inside('-u 0:0 --cap-add=SYS_ADMIN --network ci_local-infra') {
docker.image('ubuntu-18.04-common').inside('-u 0:0 --ulimit nofile=1024:1024 --cap-add=SYS_ADMIN --network ci_local-infra') {
stage('checkout sources') {
checkout(scm)
dir('buildscripts/infrastructure/build-nodes/gnu-toolchain/') {
Expand All @@ -30,7 +30,7 @@ DISTRO_LIST.each { DISTRO ->
node {
docker.withRegistry(DOCKER_REGISTRY, 'nexus') {
docker.image('ubuntu-18.04-common').pull()
docker.image('ubuntu-18.04-common').inside('-u 0:0 -v /var/run/docker.sock:/var/run/docker.sock --cap-add=SYS_ADMIN --network ci_local-infra') {
docker.image('ubuntu-18.04-common').inside('-u 0:0 --ulimit nofile=1024:1024 -v /var/run/docker.sock:/var/run/docker.sock --cap-add=SYS_ADMIN --network ci_local-infra') {
stage('build' + DISTRO + ' image') {
unstash name: 'dockerfiles'
dir('buildscripts/infrastructure/build-nodes/' + DISTRO) {
Expand Down
2 changes: 1 addition & 1 deletion buildscripts/scripts/incremental-build.jenkins
Expand Up @@ -5,7 +5,7 @@ def DAILY_DATA = '/var/jenkins_home/daily-data'
DISTRO_LIST.each { DISTRO ->
BUILDS[DISTRO] = {
node {
docker.image(DISTRO).inside('--cap-add=SYS_ADMIN -u 0:0 --network local-infra') {
docker.image(DISTRO).inside('--cap-add=SYS_ADMIN -u 0:0 --ulimit nofile=1024:1024 --network local-infra') {
stage(DISTRO + 'cleanup') {
cleanWs()
sh "mount -t overlay overlay -o lowerdir=${DAILY_DATA}/git,upperdir=${DAILY_DATA}/${DISTRO}-dest,workdir=${DAILY_DATA}/${DISTRO}-work ${DAILY_DATA}/${DISTRO}-dest"
Expand Down
6 changes: 3 additions & 3 deletions buildscripts/scripts/integration-daily-master.jenkins
Expand Up @@ -37,7 +37,7 @@ node {
IMAGE = 'ubuntu-18.04-common'
println(IMAGE)
docker.image(IMAGE).pull()
docker.image(IMAGE).inside('-u 0:0 --cap-add=SYS_ADMIN --network ci_local-infra') {
docker.image(IMAGE).inside('-u 0:0 --ulimit nofile=1024:1024 --cap-add=SYS_ADMIN --network ci_local-infra') {
stage('checkout sources') {
cleanWs()
dir(TEST_DATA + '/git') {
Expand All @@ -54,7 +54,7 @@ try {
node {
docker.withRegistry(DOCKER_REGISTRY, 'nexus') {
docker.image(DISTRO + '-os-image').pull()
docker.image(DISTRO + '-os-image').inside("-u 0:0 -v /bauwelt/download/$CMK_VERSION:/bauwelt/download/$CMK_VERSION:ro -v $TEST_DATA:$TEST_DATA --init --privileged --network ci_local-infra --hostname ${DISTRO}") {
docker.image(DISTRO + '-os-image').inside("-u 0:0 --ulimit nofile=1024:1024 -v /bauwelt/download/$CMK_VERSION:/bauwelt/download/$CMK_VERSION:ro -v $TEST_DATA:$TEST_DATA --init --privileged --network ci_local-infra --hostname ${DISTRO}") {
stage('install ' + DISTRO + ' omd') {
DISTRO_CODE = sh ( script: """
case $DISTRO in
Expand Down Expand Up @@ -160,7 +160,7 @@ try {
docker.withRegistry(DOCKER_REGISTRY, 'nexus') {
println(DOCKER_REGISTRY)
IMAGE = 'ubuntu-18.04-common'
docker.image(IMAGE).inside('-u 0:0 --cap-add=SYS_ADMIN --network ci_local-infra') {
docker.image(IMAGE).inside('-u 0:0 --ulimit nofile=1024:1024 --cap-add=SYS_ADMIN --network ci_local-infra') {
stage('checkout sources') {
sh 'rm -rf results'
dir('results') {
Expand Down
10 changes: 5 additions & 5 deletions buildscripts/scripts/nightly-build.jenkins
Expand Up @@ -65,7 +65,7 @@ node {
docker.withRegistry(DOCKER_REGISTRY, 'nexus') {
IMAGE = 'ubuntu-18.04-common'
docker.image(IMAGE).pull()
docker.image(IMAGE).inside('-u 0:0 -v /var/jenkins_home/daily-data/:/var/jenkins_home/daily-data/ --network ci_local-infra') {
docker.image(IMAGE).inside('-u 0:0 --ulimit nofile=1024:1024 -v /var/jenkins_home/daily-data/:/var/jenkins_home/daily-data/ --network ci_local-infra') {
stage('checkout sources') {
sh "rm -rf ${DAILY_DATA}"
sh 'rm -rf *'
Expand Down Expand Up @@ -121,7 +121,7 @@ AGENT_LIST.each { AGENT ->
node {
docker.withRegistry(DOCKER_REGISTRY, 'nexus') {
docker.image('agent-builder-' + AGENT).pull()
docker.image('agent-builder-' + AGENT).inside("-u 0:0 -v ${DAILY_DATA}:${DAILY_DATA} --privileged --network ci_local-infra") {
docker.image('agent-builder-' + AGENT).inside("-u 0:0 --ulimit nofile=1024:1024 -v ${DAILY_DATA}:${DAILY_DATA} --privileged --network ci_local-infra") {
stage('build agent ' + AGENT) {
if (AGENT == 'linux-64bit') {
AGENT = ''
Expand Down Expand Up @@ -177,7 +177,7 @@ node {
docker.withRegistry(DOCKER_REGISTRY, 'nexus') {
IMAGE = 'ubuntu-18.04-common'
docker.image(IMAGE).pull()
docker.image(IMAGE).inside("-u 0:0 -v ${DAILY_DATA}:${DAILY_DATA} --network ci_local-infra") {
docker.image(IMAGE).inside("-u 0:0 --ulimit nofile=1024:1024 -v ${DAILY_DATA}:${DAILY_DATA} --network ci_local-infra") {
stage('create tarball') {
sh 'rm -rf *'
unstash name: 'WinMSI'
Expand All @@ -203,7 +203,7 @@ try {
node {
docker.withRegistry(DOCKER_REGISTRY, 'nexus') {
docker.image(DISTRO).pull()
docker.image(DISTRO).inside("-u 0:0 -v ${DAILY_DATA}:${DAILY_DATA} --privileged --network ci_local-infra --hostname ${DISTRO}") {
docker.image(DISTRO).inside("-u 0:0 --ulimit nofile=1024:1024 -v ${DAILY_DATA}:${DAILY_DATA} --privileged --network ci_local-infra --hostname ${DISTRO}") {
stage('build' + DISTRO + ' package') {
sh 'rm -rf *'
sh 'mkdir work dest'
Expand Down Expand Up @@ -240,7 +240,7 @@ try {
docker.withRegistry(DOCKER_REGISTRY, 'nexus') {
IMAGE = 'ubuntu-18.04-common'
docker.image(IMAGE).pull()
docker.image(IMAGE).inside("-u 0:0 -v ${DAILY_DATA}:${DAILY_DATA} -v ${PACKAGE_DIR}:${PACKAGE_DIR} -v ${GPG_KEY_DIR}:${GPG_KEY_DIR}:ro -v ${RELEASE_KEY_DIR}:${RELEASE_KEY_DIR}:ro --network ci_local-infra") {
docker.image(IMAGE).inside("-u 0:0 --ulimit nofile=1024:1024 -v ${DAILY_DATA}:${DAILY_DATA} -v ${PACKAGE_DIR}:${PACKAGE_DIR} -v ${GPG_KEY_DIR}:${GPG_KEY_DIR}:ro -v ${RELEASE_KEY_DIR}:${RELEASE_KEY_DIR}:ro --network ci_local-infra") {
stage('Sign artifacts') {
sh """
mkdir -p ${ARCHIVE_DIR}
Expand Down
2 changes: 1 addition & 1 deletion buildscripts/scripts/nightly-cmk-container.jenkins
Expand Up @@ -21,7 +21,7 @@ node {
docker.withRegistry(DOCKER_REGISTRY, 'nexus') {
IMAGE = 'ubuntu-18.04-common'
docker.image(IMAGE).pull()
docker.image(IMAGE).inside("-u 0:0 -v ${PACKAGE_DIR}/${CMK_VERS}:${PACKAGE_DIR}/${CMK_VERS} -v ${DAILY_DATA}:${DAILY_DATA} -v /var/run/docker.sock:/var/run/docker.sock -v ${GPG_KEY_DIR}:${GPG_KEY_DIR}:ro -v ${RELEASE_KEY_DIR}:${RELEASE_KEY_DIR} -v /root/.cmk-credentials:/root/.cmk-credentials --network ci_local-infra") {
docker.image(IMAGE).inside("-u 0:0 --ulimit nofile=1024:1024 -v ${PACKAGE_DIR}/${CMK_VERS}:${PACKAGE_DIR}/${CMK_VERS} -v ${DAILY_DATA}:${DAILY_DATA} -v /var/run/docker.sock:/var/run/docker.sock -v ${GPG_KEY_DIR}:${GPG_KEY_DIR}:ro -v ${RELEASE_KEY_DIR}:${RELEASE_KEY_DIR} -v /root/.cmk-credentials:/root/.cmk-credentials --network ci_local-infra") {
stage('Build Container') {
sh """
cd ${DAILY_DATA}/git/
Expand Down
4 changes: 2 additions & 2 deletions buildscripts/scripts/os-nodes.jenkins
Expand Up @@ -16,7 +16,7 @@ node {
docker.withRegistry(DOCKER_REGISTRY, 'nexus') {
IMAGE = 'ubuntu-18.04-common'
docker.image(IMAGE).pull()
docker.image(IMAGE).inside('-u 0:0 --cap-add=SYS_ADMIN --network ci_local-infra') {
docker.image(IMAGE).inside('-u 0:0 --ulimit nofile=1024:1024 --cap-add=SYS_ADMIN --network ci_local-infra') {
stage('checkout sources') {
cleanWs()
checkout(scm)
Expand All @@ -32,7 +32,7 @@ DISTRO_LIST.each { DISTRO ->
node {
docker.withRegistry(DOCKER_REGISTRY, 'nexus') {
IMAGE = 'ubuntu-18.04-common'
docker.image(IMAGE).inside('-u 0:0 -v /var/run/docker.sock:/var/run/docker.sock --cap-add=SYS_ADMIN --network ci_local-infra') {
docker.image(IMAGE).inside('-u 0:0 --ulimit nofile=1024:1024 -v /var/run/docker.sock:/var/run/docker.sock --cap-add=SYS_ADMIN --network ci_local-infra') {
stage('build ' + DISTRO + ' os-image') {
unstash name: 'dockerfiles'
unstash name: 'distroinfos'
Expand Down

0 comments on commit 907c7f5

Please sign in to comment.