Skip to content
This repository was archived by the owner on Oct 13, 2023. It is now read-only.

Commit b49692c

Browse files
authored
Merge pull request #382 from thaJeztah/19.03_backport_test_fixes
[19.03 backport] Testing and Jenkinsfile changes [step 1] Upstream-commit: 9eec36e483cd41619833a46e8838edad7dacd53a Component: engine
2 parents d2f06c7 + 0b2b525 commit b49692c

File tree

65 files changed

+533
-419
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+533
-419
lines changed

components/engine/Dockerfile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ RUN sed -ri "s/(httpredir|deb).debian.org/${APT_MIRROR:-deb.debian.org}/g" /etc/
3636
FROM base AS criu
3737
ARG DEBIAN_FRONTEND
3838
# Install CRIU for checkpoint/restore support
39-
ENV CRIU_VERSION 3.11
39+
ENV CRIU_VERSION 3.12
4040
# Install dependency packages specific to criu
4141
RUN apt-get update && apt-get install -y --no-install-recommends \
4242
libnet-dev \
@@ -281,8 +281,6 @@ COPY --from=djs55/vpnkit@sha256:e508a17cfacc8fd39261d5b4e397df2b953690da577e2c98
281281

282282
ENV PATH=/usr/local/cli:$PATH
283283
ENV DOCKER_BUILDTAGS apparmor seccomp selinux
284-
# Options for hack/validate/gometalinter
285-
ENV GOMETALINTER_OPTS="--deadline=2m"
286284
WORKDIR /go/src/github.com/docker/docker
287285
VOLUME /var/lib/docker
288286
# Wrap all commands in the "docker-in-docker" script to allow nested containers

components/engine/Dockerfile.windows

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,8 @@ RUN `
214214
Download-File $location C:\gitsetup.zip; `
215215
`
216216
Write-Host INFO: Downloading go...; `
217-
Download-File $('https://golang.org/dl/go'+$Env:GO_VERSION+'.windows-amd64.zip') C:\go.zip; `
217+
$dlGoVersion=$Env:GO_VERSION -replace '\.0$',''; `
218+
Download-File "https://golang.org/dl/go${dlGoVersion}.windows-amd64.zip" C:\go.zip; `
218219
`
219220
Write-Host INFO: Downloading compiler 1 of 3...; `
220221
Download-File https://raw.githubusercontent.com/jhowardmsft/docker-tdmgcc/master/gcc.zip C:\gcc.zip; `

components/engine/Jenkinsfile

Lines changed: 91 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,27 @@ pipeline {
2222
DOCKER_GRAPHDRIVER = 'overlay2'
2323
APT_MIRROR = 'cdn-fastly.deb.debian.org'
2424
CHECK_CONFIG_COMMIT = '78405559cfe5987174aa2cb6463b9b2c1b917255'
25+
TESTDEBUG = '0'
2526
TIMEOUT = '120m'
2627
}
2728
stages {
29+
stage('pr-hack') {
30+
when { changeRequest() }
31+
steps {
32+
script {
33+
echo "Workaround for PR auto-cancel feature. Borrowed from https://issues.jenkins-ci.org/browse/JENKINS-43353"
34+
def buildNumber = env.BUILD_NUMBER as int
35+
if (buildNumber > 1) milestone(buildNumber - 1)
36+
milestone(buildNumber)
37+
}
38+
}
39+
}
2840
stage('DCO-check') {
2941
when {
3042
beforeAgent true
3143
expression { !params.skip_dco }
3244
}
33-
agent { label 'linux' }
45+
agent { label 'amd64 && ubuntu-1804 && overlay2' }
3446
steps {
3547
sh '''
3648
docker run --rm \
@@ -257,13 +269,13 @@ pipeline {
257269
run_tests() {
258270
[ -n "$TESTDEBUG" ] && rm= || rm=--rm;
259271
docker run $rm -t --privileged \
260-
-v "$WORKSPACE/bundles:/go/src/github.com/docker/docker/bundles" \
272+
-v "$WORKSPACE/bundles/${TEST_INTEGRATION_DEST}:/go/src/github.com/docker/docker/bundles" \
273+
-v "$WORKSPACE/bundles/dynbinary-daemon:/go/src/github.com/docker/docker/bundles/dynbinary-daemon" \
261274
-v "$WORKSPACE/.git:/go/src/github.com/docker/docker/.git" \
262275
--name "$CONTAINER_NAME" \
263276
-e KEEPBUNDLE=1 \
264277
-e TESTDEBUG \
265278
-e TESTFLAGS \
266-
-e TEST_INTEGRATION_DEST \
267279
-e TEST_SKIP_INTEGRATION \
268280
-e TEST_SKIP_INTEGRATION_CLI \
269281
-e DOCKER_GITCOMMIT=${GIT_COMMIT} \
@@ -308,14 +320,20 @@ pipeline {
308320
exit $c
309321
'''
310322
}
323+
post {
324+
always {
325+
junit testResults: 'bundles/**/*-report.xml', allowEmptyResults: true
326+
}
327+
}
311328
}
312329
}
313330

314331
post {
315332
always {
316333
sh '''
317334
echo "Ensuring container killed."
318-
docker rm -vf docker-pr$BUILD_NUMBER || true
335+
cids=$(docker ps -aq -f name=docker-pr${BUILD_NUMBER}-*)
336+
[ -n "$cids" ] && docker rm -vf $cids || true
319337
'''
320338

321339
sh '''
@@ -328,7 +346,7 @@ pipeline {
328346
bundleName=amd64
329347
echo "Creating ${bundleName}-bundles.tar.gz"
330348
# exclude overlay2 directories
331-
find bundles -path '*/root/*overlay2' -prune -o -type f \\( -name '*.log' -o -name '*.prof' \\) -print | xargs tar -czf ${bundleName}-bundles.tar.gz
349+
find bundles -path '*/root/*overlay2' -prune -o -type f \\( -name '*-report.json' -o -name '*.log' -o -name '*.prof' -o -name '*-report.xml' \\) -print | xargs tar -czf ${bundleName}-bundles.tar.gz
332350
'''
333351

334352
archiveArtifacts artifacts: '*-bundles.tar.gz', allowEmptyArchive: true
@@ -397,6 +415,7 @@ pipeline {
397415
-e DOCKER_EXPERIMENTAL \
398416
-e DOCKER_GITCOMMIT=${GIT_COMMIT} \
399417
-e DOCKER_GRAPHDRIVER \
418+
-e TESTDEBUG \
400419
-e TEST_SKIP_INTEGRATION_CLI \
401420
-e TIMEOUT \
402421
docker:${GIT_COMMIT} \
@@ -405,6 +424,11 @@ pipeline {
405424
test-integration
406425
'''
407426
}
427+
post {
428+
always {
429+
junit testResults: 'bundles/**/*-report.xml', allowEmptyResults: true
430+
}
431+
}
408432
}
409433
}
410434

@@ -425,7 +449,7 @@ pipeline {
425449
bundleName=s390x-integration
426450
echo "Creating ${bundleName}-bundles.tar.gz"
427451
# exclude overlay2 directories
428-
find bundles -path '*/root/*overlay2' -prune -o -type f \\( -name '*.log' -o -name '*.prof' \\) -print | xargs tar -czf ${bundleName}-bundles.tar.gz
452+
find bundles -path '*/root/*overlay2' -prune -o -type f \\( -name '*-report.json' -o -name '*.log' -o -name '*.prof' -o -name '*-report.xml' \\) -print | xargs tar -czf ${bundleName}-bundles.tar.gz
429453
'''
430454

431455
archiveArtifacts artifacts: '*-bundles.tar.gz', allowEmptyArchive: true
@@ -483,6 +507,11 @@ pipeline {
483507
test-integration
484508
'''
485509
}
510+
post {
511+
always {
512+
junit testResults: 'bundles/**/*-report.xml', allowEmptyResults: true
513+
}
514+
}
486515
}
487516
}
488517

@@ -503,7 +532,7 @@ pipeline {
503532
bundleName=s390x-integration-cli
504533
echo "Creating ${bundleName}-bundles.tar.gz"
505534
# exclude overlay2 directories
506-
find bundles -path '*/root/*overlay2' -prune -o -type f \\( -name '*.log' -o -name '*.prof' \\) -print | xargs tar -czf ${bundleName}-bundles.tar.gz
535+
find bundles -path '*/root/*overlay2' -prune -o -type f \\( -name '*-report.json' -o -name '*.log' -o -name '*.prof' -o -name '*-report.xml' \\) -print | xargs tar -czf ${bundleName}-bundles.tar.gz
507536
'''
508537

509538
archiveArtifacts artifacts: '*-bundles.tar.gz', allowEmptyArchive: true
@@ -570,6 +599,7 @@ pipeline {
570599
-e DOCKER_EXPERIMENTAL \
571600
-e DOCKER_GITCOMMIT=${GIT_COMMIT} \
572601
-e DOCKER_GRAPHDRIVER \
602+
-e TESTDEBUG \
573603
-e TEST_SKIP_INTEGRATION_CLI \
574604
-e TIMEOUT \
575605
docker:${GIT_COMMIT} \
@@ -578,6 +608,11 @@ pipeline {
578608
test-integration
579609
'''
580610
}
611+
post {
612+
always {
613+
junit testResults: 'bundles/**/*-report.xml', allowEmptyResults: true
614+
}
615+
}
581616
}
582617
}
583618

@@ -598,7 +633,7 @@ pipeline {
598633
bundleName=ppc64le-integration
599634
echo "Creating ${bundleName}-bundles.tar.gz"
600635
# exclude overlay2 directories
601-
find bundles -path '*/root/*overlay2' -prune -o -type f \\( -name '*.log' -o -name '*.prof' \\) -print | xargs tar -czf ${bundleName}-bundles.tar.gz
636+
find bundles -path '*/root/*overlay2' -prune -o -type f \\( -name '*-report.json' -o -name '*.log' -o -name '*.prof' -o -name '*-report.xml' \\) -print | xargs tar -czf ${bundleName}-bundles.tar.gz
602637
'''
603638

604639
archiveArtifacts artifacts: '*-bundles.tar.gz', allowEmptyArchive: true
@@ -654,6 +689,11 @@ pipeline {
654689
test-integration
655690
'''
656691
}
692+
post {
693+
always {
694+
junit testResults: 'bundles/**/*-report.xml', allowEmptyResults: true
695+
}
696+
}
657697
}
658698
}
659699

@@ -662,8 +702,6 @@ pipeline {
662702
sh '''
663703
echo "Ensuring container killed."
664704
docker rm -vf docker-pr$BUILD_NUMBER || true
665-
cids=$(docker ps -aq -f name=docker-pr${BUILD_NUMBER}-*)
666-
[ -n "$cids" ] && docker rm -vf $cids || true
667705
'''
668706

669707
sh '''
@@ -676,7 +714,7 @@ pipeline {
676714
bundleName=ppc64le-integration-cli
677715
echo "Creating ${bundleName}-bundles.tar.gz"
678716
# exclude overlay2 directories
679-
find bundles -path '*/root/*overlay2' -prune -o -type f \\( -name '*.log' -o -name '*.prof' \\) -print | xargs tar -czf ${bundleName}-bundles.tar.gz
717+
find bundles -path '*/root/*overlay2' -prune -o -type f \\( -name '*-report.json' -o -name '*.log' -o -name '*.prof' -o -name '*-report.xml' \\) -print | xargs tar -czf ${bundleName}-bundles.tar.gz
680718
'''
681719

682720
archiveArtifacts artifacts: '*-bundles.tar.gz', allowEmptyArchive: true
@@ -699,11 +737,12 @@ pipeline {
699737
}
700738
environment {
701739
DOCKER_BUILDKIT = '0'
740+
DOCKER_DUT_DEBUG = '1'
702741
SKIP_VALIDATION_TESTS = '1'
703742
SOURCES_DRIVE = 'd'
704743
SOURCES_SUBDIR = 'gopath'
705744
TESTRUN_DRIVE = 'd'
706-
TESTRUN_SUBDIR = "CI-$BUILD_NUMBER"
745+
TESTRUN_SUBDIR = "CI"
707746
WINDOWS_BASE_IMAGE = 'mcr.microsoft.com/windows/servercore'
708747
WINDOWS_BASE_IMAGE_TAG = 'ltsc2016'
709748
}
@@ -732,6 +771,25 @@ pipeline {
732771
}
733772
}
734773
}
774+
post {
775+
always {
776+
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE', message: 'Failed to create bundles.tar.gz') {
777+
powershell '''
778+
$bundleName="windowsRS1-integration"
779+
Write-Host -ForegroundColor Green "Creating ${bundleName}-bundles.zip"
780+
781+
# archiveArtifacts does not support env-vars to , so save the artifacts in a fixed location
782+
Compress-Archive -Path "${env:TEMP}/CIDUT.out", "${env:TEMP}/CIDUT.err" -CompressionLevel Optimal -DestinationPath "${bundleName}-bundles.zip"
783+
'''
784+
785+
archiveArtifacts artifacts: '*-bundles.zip', allowEmptyArchive: true
786+
}
787+
}
788+
cleanup {
789+
sh 'make clean'
790+
deleteDir()
791+
}
792+
}
735793
}
736794
stage('win-RS5') {
737795
when {
@@ -740,11 +798,12 @@ pipeline {
740798
}
741799
environment {
742800
DOCKER_BUILDKIT = '0'
801+
DOCKER_DUT_DEBUG = '1'
743802
SKIP_VALIDATION_TESTS = '1'
744803
SOURCES_DRIVE = 'd'
745804
SOURCES_SUBDIR = 'gopath'
746805
TESTRUN_DRIVE = 'd'
747-
TESTRUN_SUBDIR = "CI-$BUILD_NUMBER"
806+
TESTRUN_SUBDIR = "CI"
748807
WINDOWS_BASE_IMAGE = 'mcr.microsoft.com/windows/servercore'
749808
WINDOWS_BASE_IMAGE_TAG = 'ltsc2019'
750809
}
@@ -772,6 +831,25 @@ pipeline {
772831
}
773832
}
774833
}
834+
post {
835+
always {
836+
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE', message: 'Failed to create bundles.tar.gz') {
837+
powershell '''
838+
$bundleName="windowsRS5-integration"
839+
Write-Host -ForegroundColor Green "Creating ${bundleName}-bundles.zip"
840+
841+
# archiveArtifacts does not support env-vars to , so save the artifacts in a fixed location
842+
Compress-Archive -Path "${env:TEMP}/CIDUT.out", "${env:TEMP}/CIDUT.err" -CompressionLevel Optimal -DestinationPath "${bundleName}-bundles.zip"
843+
'''
844+
845+
archiveArtifacts artifacts: '*-bundles.zip', allowEmptyArchive: true
846+
}
847+
}
848+
cleanup {
849+
sh 'make clean'
850+
deleteDir()
851+
}
852+
}
775853
}
776854
}
777855
}

components/engine/MAINTAINERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@
111111
# still stumble into him in our issue tracker, or on IRC.
112112
"erikh",
113113

114-
# Evan Hazlett is the creator of of the Shipyard and Interlock open source projects,
114+
# Evan Hazlett is the creator of the Shipyard and Interlock open source projects,
115115
# and the author of "Orca", which became the foundation of Docker Universal Control
116116
# Plane (UCP). As a maintainer, Evan helped integrating SwarmKit (secrets, tasks)
117117
# into the Docker engine.

components/engine/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ DOCKER_ENVS := \
5353
-e DOCKER_TEST_HOST \
5454
-e DOCKER_USERLANDPROXY \
5555
-e DOCKERD_ARGS \
56-
-e TEST_INTEGRATION_DEST \
5756
-e TEST_INTEGRATION_DIR \
5857
-e TEST_SKIP_INTEGRATION \
5958
-e TEST_SKIP_INTEGRATION_CLI \

components/engine/api/swagger.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3262,7 +3262,7 @@ definitions:
32623262
32633263
<p><br /></p>
32643264
3265-
- "ingress" makes the target port accessible on on every node,
3265+
- "ingress" makes the target port accessible on every node,
32663266
regardless of whether there is a task for the service running on
32673267
that node or not.
32683268
- "host" bypasses the routing mesh and publish the port directly on

0 commit comments

Comments
 (0)