11name : Docker Build
22
33on :
4- workflow_call :
4+ release :
5+ types : [published]
56 workflow_dispatch :
67 inputs :
78 branch :
89 description : ' Branch to run scans on'
910 default : ' main'
1011 type : string
12+ workflow_call :
1113 pull_request :
1214 push :
1315 branches : [ "main" ]
@@ -18,68 +20,146 @@ permissions:
1820
1921env :
2022 BUILD_TYPE : " Release"
23+ CMAKE_BUILD_TYPE : " Release"
24+ DOCKER_REGISTRY : " ghcr.io"
25+ DOCKER_LOGIN : " ${{ github.repository == 'openvisualcloud/intel-tiber-broadcast-suite' }}"
26+ DOCKER_REGISTRY_NAMESPACE : ' openvisualcloud/intel-tiber-broadcast-suite'
2127 DOCKER_IMAGE_BASE : " ghcr.io/openvisualcloud/intel-tiber-broadcast-suite"
2228 DOCKER_IMAGE_NAME : " tiber-broadcast-suite"
23- DOCKER_IMAGE_TAG : " ${{ github.sha }}"
29+ DOCKER_IMAGE_TAG : " ${{ inputs.branch || github.sha || github.ref }}"
2430 DEBIAN_FRONTEND : " noninteractive"
2531
2632concurrency :
2733 group : ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
2834 cancel-in-progress : true
2935
3036jobs :
31- docker :
37+ docker-tiber :
3238 name : " Dockerfile build for Intel® Tiber™ Broadcast Suite"
33- runs-on : ubuntu-22.04
34- timeout-minutes : 120
39+ runs-on : ["self-hosted", "docker", "Linux"]
40+ timeout-minutes : 180
41+ permissions :
42+ contents : read
43+ packages : write
44+ env :
45+ BUILDKIT_STEP_LOG_MAX_SIZE : 50000000
46+ BUILDKIT_STEP_LOG_MAX_SPEED : 10000000
47+ DOCKER_TMPDIR : " /mnt/docker/docker-tmp"
48+ TAG_NAME : ${{ github.event_name == 'release' && github.event.release.tag_name || github.ref }}
49+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
50+ steps :
51+ - name : " OS-Configuration: Harden Runner"
52+ uses : step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1
53+ with :
54+ egress-policy : audit
55+
56+ - name : " OS-Configuration: Docker with Buildx Toolkit set up"
57+ uses : docker/setup-buildx-action@4fd812986e6c8c2a69e18311145f9371337f27d4 # v3.4.0
58+
59+ - name : " Code-Sync: GitHub git checkout push"
60+ if : github.event_name == 'push' || github.event_name == 'workflow_dispatch'
61+ uses : actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
62+ with :
63+ ref : ${{ inputs.branch || github.sha }}
64+
65+ - name : " Code-Sync: GitHub git checkout pull_request or release"
66+ if : github.event_name == 'pull_request' || github.event_name == 'release'
67+ uses : actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
68+ with :
69+ ref : ${{ github.event_name == 'release' && github.event.release.tag_name || github.ref }}
70+
71+ - name : " Docker: Login to ghcr.io Container Registry"
72+ uses : docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
73+ if : ${{ env.DOCKER_LOGIN == 'true' }}
74+ continue-on-error : true
75+ with :
76+ registry : " ghcr.io"
77+ username : " ${{ secrets.DOCKER_REGISTRY_LOGIN || github.repository_owner }}"
78+ password : " ${{ secrets.DOCKER_REGISTRY_PASSKEY || secrets.GITHUB_TOKEN }}"
79+
80+ - name : " Build and push mtl-manager image"
81+ run : ./build.sh
82+ env :
83+ BUILD_TYPE : " CI"
84+ CMAKE_BUILD_TYPE : " Release"
85+ LOCAL_INSTALL : " false"
86+ IMAGE_NAME : " mtl-manager"
87+ IMAGE_PATH : " ./docker/app/Dockerfile"
88+ BUILD_SCOPE : " ./"
89+ BUILD_STAGE : " manager-stage"
90+
91+ - name : " Build and push tiber-broadcast-suite image"
92+ run : ./build.sh
93+ env :
94+ BUILD_TYPE : " CI"
95+ CMAKE_BUILD_TYPE : " Release"
96+ LOCAL_INSTALL : " false"
97+ IMAGE_NAME : " tiber-broadcast-suite"
98+ IMAGE_PATH : " ./docker/app/Dockerfile"
99+ BUILD_SCOPE : " ./"
100+ BUILD_STAGE : " final-stage"
101+
102+ docker-aux :
103+ name : " Dockerfile build for Intel® Tiber™ NMOS and BCS containers"
104+ runs-on : ["self-hosted", "docker", "Linux"]
105+ timeout-minutes : 180
35106 permissions :
36107 contents : read
37- security-events : write
108+ packages : write
38109 env :
39110 BUILDKIT_STEP_LOG_MAX_SIZE : 50000000
40111 BUILDKIT_STEP_LOG_MAX_SPEED : 10000000
41112 DOCKER_TMPDIR : " /mnt/docker/docker-tmp"
113+ TAG_NAME : ${{ github.event_name == 'release' && github.event.release.tag_name || github.ref }}
114+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
42115 steps :
43- - name : " OS-Configuration: Preparation: Harden Runner"
116+ - name : " OS-Configuration: Harden Runner"
44117 uses : step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1
45118 with :
46119 egress-policy : audit
47120
48- - name : " OS-Configuration: Report memory, block-dev and free disk space."
49- run : |
50- sudo free -h
51- sudo lsblk
52- sudo df -h
53-
54- - name : " OS-Configuration: Disable SWAP in OS, create mnt points, show settings."
55- shell : bash
56- run : |
57- export SWAP_FILE="$(sudo swapon --show=NAME | tail -n 1)"
58- sudo swapoff "${SWAP_FILE}"
59- sudo rm "${SWAP_FILE}"
60- sudo mkdir -p "/mnt/docker/docker-d" "/mnt/docker/docker-tmp"
61-
62- - name : " OS-Configuration: Add data-root and other JSON changes to dockerd, reload it."
63- run : |
64- sudo chmod 666 /etc/docker/daemon.json
65- echo "$(sudo jq '. += {"data-root":"/mnt/docker/docker-d","log-driver":"json-file","log-format":"text","log-level":"info","log-opts":{"cache-disabled":"false","cache-max-file":"5","cache-max-size":"20m","max-file":"5","max-size":"10m"}}' /etc/docker/daemon.json)" > /etc/docker/daemon.json
66- sudo chmod 644 /etc/docker/daemon.json
67- sudo systemctl daemon-reload
68- sudo systemctl restart docker
69- sudo cat "/etc/docker/daemon.json"
70-
71- - name : " Configuration: Docker with Buildx Toolkit set up"
72- uses : docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb # v3.3.0
121+ - name : " OS-Configuration: Docker with Buildx Toolkit set up"
122+ uses : docker/setup-buildx-action@4fd812986e6c8c2a69e18311145f9371337f27d4 # v3.4.0
123+
124+ - name : " Code-Sync: GitHub git checkout push"
125+ if : github.event_name == 'push' || github.event_name == 'workflow_dispatch'
126+ uses : actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
73127 with :
74- buildkitd-flags : " --debug --allow-insecure-entitlement security.insecure --allow-insecure-entitlement network.host"
75- platforms : " linux/amd64"
76- driver-opts : memory=14Gib,memory-swap=25Gib,env.BUILDKIT_STEP_LOG_MAX_SIZE=50000000,env.BUILDKIT_STEP_LOG_MAX_SPEED=10000000
77-
78- - uses : actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
128+ ref : ${{ inputs.branch || github.sha }}
129+
130+ - name : " Code-Sync: GitHub git checkout pull_request or release"
131+ if : github.event_name == 'pull_request' || github.event_name == 'release'
132+ uses : actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
133+ with :
134+ ref : ${{ github.event_name == 'release' && github.event.release.tag_name || github.ref }}
135+
136+ - name : " Docker: Login to ghcr.io Container Registry"
137+ uses : docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
138+ if : ${{ env.DOCKER_LOGIN == 'true' }}
139+ continue-on-error : true
79140 with :
80- ref : ${{ inputs.branch }}
141+ registry : " ghcr.io"
142+ username : " ${{ secrets.DOCKER_REGISTRY_LOGIN || github.repository_owner }}"
143+ password : " ${{ secrets.DOCKER_REGISTRY_PASSKEY || secrets.GITHUB_TOKEN }}"
144+
145+ - name : " Build and push tiber-broadcast-suite-nmos-node image"
146+ run : ./build.sh
147+ env :
148+ BUILD_TYPE : " CI"
149+ CMAKE_BUILD_TYPE : " Release"
150+ LOCAL_INSTALL : " false"
151+ IMAGE_NAME : " tiber-broadcast-suite-nmos-node"
152+ IMAGE_PATH : " ./docker/nmos/Dockerfile"
153+ BUILD_SCOPE : " ./"
154+ BUILD_STAGE : " final-stage"
81155
82- - name : " validate build.sh script "
156+ - name : " Build and push bcs-pod-launcher image "
83157 run : ./build.sh
84158 env :
85159 BUILD_TYPE : " CI"
160+ CMAKE_BUILD_TYPE : " Release"
161+ LOCAL_INSTALL : " false"
162+ IMAGE_NAME : " bcs-pod-launcher"
163+ IMAGE_PATH : " ./launcher/Dockerfile"
164+ BUILD_SCOPE : " ./launcher"
165+ BUILD_STAGE : " "
0 commit comments