CONTAINERS AND
GITLAB
1
CONTAINERISATION
Docker part 2
GitLab
2
DOCKER PART 2
3
DOCKER PART 2
Handling different stages
Handling different archs
4
HANDLING DIFFERENT STAGES
PURPOSE OF DIFFERENT STAGES
Different packages and/or tools needed for
a build
running
5
HANDLING DIFFERENT STAGES
EXAMPLE
6
HANDLING DIFFERENT STAGES
EXAMPLE
USING 2 DIFFERENT STAGES
Build
Creating site web pages etc.
Production
Creating a deployment image with site
pages
Example is limited to two stages, could use
many as needed
6.1
HANDLING DIFFERENT STAGES
EXAMPLE
Build stage its associated build commands
6.2
HANDLING DIFFERENT STAGES
EXAMPLE
Build stage its associated build commands
Image specifically for the build stage
Node used as its a node project
All usual commands work
6.3
HANDLING DIFFERENT STAGES
EXAMPLE
Build stage its associated build commands
Image specifically for the build stage
Node used as its a node project
All usual commands work
Production stage its associated commands
6.4
HANDLING DIFFERENT STAGES
EXAMPLE
Build stage its associated build commands
Image specifically for the build stage
Node used as its a node project
All usual commands work
Production stage its associated commands
Image specifically for the production stage
ngxin - Need a web server
6.5
HANDLING DIFFERENT STAGES
EXAMPLE
Build stage its associated build commands
Image specifically for the build stage
Node used as its a node project
All usual commands work
Production stage its associated commands
Image specifically for the production stage
ngxin - Need a web server
The artifacts from the build stage
Copied to the production stage
6.6
HANDLING DIFFERENT STAGES
EXAMPLE
Build stage its associated build commands
Image specifically for the build stage
Node used as its a node project
All usual commands work
Production stage its associated commands
Image specifically for the production stage
ngxin - Need a web server
The artifacts from the build stage
Copied to the production stage
Setting up files for web server
Note that WORKDIR is /app
6.7
HANDLING DIFFERENT STAGES
EXAMPLE
Build stage its associated build commands
Image specifically for the build stage
Node used as its a node project
All usual commands work
Production stage its associated commands
Image specifically for the production stage
ngxin - Need a web server
The artifacts from the build stage
Copied to the production stage
Setting up files for web server
Note that WORKDIR is /app
Port to expose and nginx command to run
6.8
HANDLING DIFFERENT STAGES
EXAMPLE - NGINX
The nginx configuration used
for this example
Note that
root path is /app
port is 80
7
HANDLING DIFFERENT ARCHS
Why?
Deployment may be on
RPiv?
M1
Intel/AMD x64
8
HANDLING DIFFERENT ARCHS
EXAMPLE OF MULTIARCH BUILD
9
HANDLING DIFFERENT ARCHS
EXAMPLE OF MULTIARCH BUILD
We ensure that the kernel will know how to
execute commands in other architectures
Uses QEMU to run application in other
architectures than native
Specifically we need (could easily be others!)
arm64 - RPIv3-4 & M1/M2
amd64 - Intel/AMD
Depending on image being this may not be
needed
Needed if native program to architecture
needs to be run
IF needed, only needs to be run once
9.1
HANDLING DIFFERENT ARCHS
EXAMPLE OF MULTIARCH BUILD
Docker requirement that we need to create and
use a new builder
9.2
HANDLING DIFFERENT ARCHS
EXAMPLE OF MULTIARCH BUILD
Using buildx to
build
in platforms:
linux/arm64/v8
linux/amd64
9.3
GITLAB
10
GITLAB
Intro
CI/CD
Using AU Gitlab commandline
11
INTRO - SUPERFICIAL
GitLab provides all of the essential DevOps tools in one DevOps platform. From idea to
production, GitLab helps teams improve cycle time from weeks to minutes, reduce development
costs, speed time to market, and deliver more secure and compliant applications.
https://about.gitlab.com/platform/?stage=plan
12
INTRO - SUPERFICIAL
Project Packages and registries
Info Deploying
Members Deployments
Issues Infrastructure
Repository Monitor
Files Wiki
Merge requests
https://www.tutorialspoint.com/gitlab/gitlab_introduction.htm
13
PROJECT
INFO
Activies being done in the project
You can follow what happens
14
PROJECT
MEMBERS
Added members
Use it add other members to project
specifically for your exams project
In settings you can specify accessibility of the
project, possible settings are
Private
Only you and members
Internal
All authenticated users
Advise: DO
Public
Everyone
Advise: DONT!
15
PROJECT
ISSUES
Regular project handling
Issues
Boards
Swimlanes etc.
Overview of system progress
Analytics
Burndown charts etc
Advise: Whatever fits
https://docs.gitlab.com/ee/user/project/issue_board.html
https://docs.gitlab.com/ee/user/project/milestones/burndown_and_burnup_charts.html
16
REPOSITORY
FILES & MERGE REQUESTS
Overview of files
Accessibility
Cloning, forking
Web editing
History
Merge request for incoming changes
https://apps.risksciences.ucla.edu/gitlab/help/user/project/merge_requests/reviewing_and_managing_merge_requests.md
17
PACKAGES AND REGISTRIES
Packages
Create your own packages
Make them available through
Ex. supports maven, npm, Nuget
Containers
Create your own images
Make them for use in docker/k8s
Supported package manageers: https://docs.gitlab.com/ee/user/packages/package_registry/supported_package_managers.html
18
DEPLOYING
COMPLETE WITH DIFFERENT
ASPECTS OF DEPLOYING
Releases
Deployments procedures
Interaction with staging and production
envs.
Clusters
Events & metrics
https://about.gitlab.com/blog/2022/11/15/simple-kubernetes-management-with-gitlab/
https://about.gitlab.com/blog/2020/05/07/working-with-performance-metrics/
19
WIKI
Collaboratory editing
Supports: Markdown, Rdoc, AsciiDoc, and Org
Diagrams supported in MD
Mermaid - direct
PlantUML - needs to be installed
...
https://docs.gitlab.com/ee/user/project/wiki/
https://gitlab.com/groups/gitlab-org/-/epics/5438?_gl=1*kvf889*_ga*MjAzMTUzNjgxMC4xNjczNjE2NDQ0*_ga_ENFH3X7M5Y*MTY3NTUxMDQzOC4yNC4xLjE2NzU1MTI0ODQuMC4wLjA.
20
CI/CD
Whats a pipeline
Simple example
21
WHATS A PIPELINE
Control the process
Concepts
Jobs
Define what to do
Compile an app
Build an image
Are run on runners
Instances that run on a "server"
Stages
Define when to run a job
Ensure that stages are completed before the next
All jobs in a stage are in parallel
22
SIMPLE EXAMPLE
Focus is building a docker image
Using images
Building
Multi arch
Efficient
Triggering
See preparation for in-depths tutorial
23
BUILDING AN IMAGE
24
BUILDING AN IMAGE
build
No specific stages specified, just need build
24.1
BUILDING AN IMAGE
build
No specific stages specified, just need build
image is griefed/docker-with-buildx:latest
Need docker commands to build image
Note that this image includes buildx
24.2
BUILDING AN IMAGE
build
No specific stages specified, just need build
image is griefed/docker-with-buildx:latest
Need docker commands to build image
Note that this image includes buildx
Using the dind - Docker in Docker service
Docker daemon
24.3
BUILDING AN IMAGE
build
No specific stages specified, just need build
image is griefed/docker-with-buildx:latest
Need docker commands to build image
Note that this image includes buildx
Using the dind - Docker in Docker service
Docker daemon
Scripts to run before the actual stuff
24.4
BUILDING AN IMAGE
build
No specific stages specified, just need build
image is griefed/docker-with-buildx:latest
Need docker commands to build image
Note that this image includes buildx
Using the dind - Docker in Docker service
Docker daemon
Scripts to run before the actual stuff
Logging in to be able to push created image
24.5
BUILDING AN IMAGE
build
No specific stages specified, just need build
image is griefed/docker-with-buildx:latest
Need docker commands to build image
Note that this image includes buildx
Using the dind - Docker in Docker service
Docker daemon
Scripts to run before the actual stuff
Logging in to be able to push created image
We ensure that the kernel will know how to execute commands in
other architectures
Specifically we need (could easily be others!)
arm64 - RPIv3-4 & M1/M2
amd64 - Intel/AMD
24.6
BUILDING AN IMAGE
build Docker requirement that we need to create and use a new builder
No specific stages specified, just need build
image is griefed/docker-with-buildx:latest
Need docker commands to build image
Note that this image includes buildx
Using the dind - Docker in Docker service
Docker daemon
Scripts to run before the actual stuff
Logging in to be able to push created image
We ensure that the kernel will know how to execute commands in
other architectures
Specifically we need (could easily be others!)
arm64 - RPIv3-4 & M1/M2
amd64 - Intel/AMD
24.7
BUILDING AN IMAGE
build Docker requirement that we need to create and use a new builder
No specific stages specified, just need build
Actual job!
image is griefed/docker-with-buildx:latest
Need docker commands to build image
Note that this image includes buildx
Using the dind - Docker in Docker service
Docker daemon
Scripts to run before the actual stuff
Logging in to be able to push created image
We ensure that the kernel will know how to execute commands in
other architectures
Specifically we need (could easily be others!)
arm64 - RPIv3-4 & M1/M2
amd64 - Intel/AMD
24.8
BUILDING AN IMAGE
build Docker requirement that we need to create and use a new builder
No specific stages specified, just need build
Actual job!
image is griefed/docker-with-buildx:latest
Pull the latests - caching all possible layers
Need docker commands to build image
Note that this image includes buildx
Using the dind - Docker in Docker service
Docker daemon
Scripts to run before the actual stuff
Logging in to be able to push created image
We ensure that the kernel will know how to execute commands in
other architectures
Specifically we need (could easily be others!)
arm64 - RPIv3-4 & M1/M2
amd64 - Intel/AMD
24.9
BUILDING AN IMAGE
build Docker requirement that we need to create and use a new builder
No specific stages specified, just need build
Actual job!
image is griefed/docker-with-buildx:latest
Pull the latests - caching all possible layers
Need docker commands to build image
Note that this image includes buildx Using buildx to
build
Using the dind - Docker in Docker service
in platforms:
Docker daemon
linux/arm64/v8
Scripts to run before the actual stuff linux/amd64
push to registry
Logging in to be able to push created image
all in one...
We ensure that the kernel will know how to execute commands in
other architectures
Specifically we need (could easily be others!)
arm64 - RPIv3-4 & M1/M2
amd64 - Intel/AMD
24.10
BUILDING AN IMAGE
build Docker requirement that we need to create and use a new builder
No specific stages specified, just need build
Actual job!
image is griefed/docker-with-buildx:latest
Pull the latests - caching all possible layers
Need docker commands to build image
Note that this image includes buildx Using buildx to
build
Using the dind - Docker in Docker service
in platforms:
Docker daemon
linux/arm64/v8
Scripts to run before the actual stuff linux/amd64
push to registry
Logging in to be able to push created image
all in one...
We ensure that the kernel will know how to execute commands in
This is only done whenever a tag is set
other architectures
Specifically we need (could easily be others!)
arm64 - RPIv3-4 & M1/M2
amd64 - Intel/AMD
24.11