-
Notifications
You must be signed in to change notification settings - Fork 182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add IBM Dockerfile #5599
Open
danlarson-ibm
wants to merge
52
commits into
open-power:master-p10
Choose a base branch
from
danlarson-ibm:demo
base: master-p10
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Add IBM Dockerfile #5599
Changes from all commits
Commits
Show all changes
52 commits
Select commit
Hold shift + click to select a range
eb78685
Add demo files
danlarson-ibm 6b4ebf1
full compile
danlarson-ibm 6dd9a54
add Jenkinsfile
danlarson-ibm 66242b2
then
danlarson-ibm a8079ce
install git
danlarson-ibm 38f8e5c
cd
danlarson-ibm 63d2a5c
cd
danlarson-ibm 08cbcc0
branch
danlarson-ibm e811b84
workspace
danlarson-ibm 705579a
seperate podman files
danlarson-ibm 984fcc2
Add artifactory upload
danlarson-ibm 8bccbf0
remove jfrog token setting
danlarson-ibm 6509070
spaces matter
danlarson-ibm feeeceb
no dir
danlarson-ibm 6ae607d
add push
danlarson-ibm 4e39aad
-
danlarson-ibm 6b76bf1
tag_name
danlarson-ibm ee0f618
update tag
danlarson-ibm 8e38682
different name
danlarson-ibm 60c6cdb
chmod
danlarson-ibm 83241b0
try again
danlarson-ibm d65800b
short
danlarson-ibm 686554d
podman
danlarson-ibm 6353f86
faster
danlarson-ibm ceb8612
why
danlarson-ibm 2b892b8
spec is bad
danlarson-ibm 3fab19c
cp
danlarson-ibm 1f0e35d
W
danlarson-ibm c407587
{}
danlarson-ibm b112edd
idk
danlarson-ibm 3309d4e
full
danlarson-ibm 71a5772
back to spec
danlarson-ibm c9c4545
-x
danlarson-ibm dd0633f
-x
danlarson-ibm 18995c9
pls work
danlarson-ibm f4a03dc
full
danlarson-ibm c390e80
will it work
danlarson-ibm a643cbb
remove
danlarson-ibm c14ebdf
idk
danlarson-ibm 12cb23d
full path
danlarson-ibm 9c0e96f
will it work
danlarson-ibm c2b1b4c
latest
danlarson-ibm 7decca9
full latest
danlarson-ibm c2b214a
make it faster
danlarson-ibm 2f9bc2a
commit
danlarson-ibm 2fa4984
commit 2
danlarson-ibm c3472e5
how did this break
danlarson-ibm 7c97085
line breaks
danlarson-ibm b2c4de2
full thing
danlarson-ibm 667d05c
do demo
danlarson-ibm c3bfb1c
Update jenkinsfile
danlarson-ibm 84c6746
Use new params
danlarson-ibm File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
FROM fedora:37 | ||
|
||
ARG USER | ||
ARG UID | ||
ARG GID | ||
|
||
ENV USER=${USER:-no-user-set} | ||
ENV UID=${UID:-no-uid-set} | ||
ENV GID=${GID:-no-gid-set} | ||
ENV PYTHONUNBUFFERED=1 | ||
ENV HB_CONSOLE_TRACE_EN=False | ||
|
||
WORKDIR /home/$USER | ||
|
||
# Install packages | ||
COPY dnf_packages.sh . | ||
RUN ./dnf_packages.sh && dnf clean all | ||
|
||
# Install jfrog-cli for artifactory transactions | ||
RUN curl -fL https://install-cli.jfrog.io | sh | ||
RUN chmod a+x /usr/local/bin/jf | ||
|
||
# add $USER | ||
RUN groupadd -g ${GID} -o ${USER} | ||
RUN useradd -l --create-home --shell /bin/bash -u ${UID} -g ${GID} ${USER} | ||
RUN chown -R $USER /home/$USER | ||
|
||
# once we prompt USER, we are that user and no longer has sudo | ||
USER ${USER} | ||
RUN mkdir /home/${USER}/.ssh | ||
|
||
ENTRYPOINT ["/bin/bash"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,153 @@ | ||
properties([buildDiscarder(logRotator(daysToKeepStr: '30')), | ||
parameters([ | ||
booleanParam( name: 'RESET_CI_PROGRESS', | ||
defaultValue: false, | ||
description: "Change to \'true\' to erase CI job progress. This will start again at the build, then simics and hardware<br>This is useful for picking up a newer backing build"), | ||
string( name: 'EBMC_PIPELINES_BRANCH', | ||
defaultValue: 'refs/remotes/origin/pr/1283', | ||
description: "power-devops/ebmc-pipelines branch identifier, Can be branch name or refspec (refs/remotes/origin/pr/#)") | ||
]) | ||
]) | ||
|
||
ansiColor('xterm') { | ||
node('redhat-8') { | ||
timestamps { | ||
stage('Load libraries') { | ||
cleanWs() | ||
load_library ebmc_pipelines: env.EBMC_PIPELINES_BRANCH, | ||
ebmc_verified: 'main' | ||
|
||
} | ||
def fw_level = 'fw1060' // master-p10 | ||
def job_build_path = "pse-jet-sys-powerfw-generic-local/${currentBuild.fullProjectName}/${currentBuild.id}/" | ||
def change_identifiers = [:] | ||
if (env.ghprbActualCommit) { | ||
//ibm-release-fw1020 | ||
//release-fw1030 | ||
if (env.ghprbTargetBranch.contains('release-fw10')) { | ||
fw_level = env.ghprbTargetBranch.split('-')[-1] | ||
} | ||
job_build_path = "pse-jet-sys-powerfw-generic-local/${github.get_org_name()}/${github.get_repo_name()}/${env.ghprbTargetBranch}/${github.get_pr_number()}/${github.get_short_hash()}/" | ||
currentBuild.displayName = "#${env.BUILD_NUMBER} ${env?.ghprbPullTitle}" | ||
currentBuild.description = "${env?.ghprbActualCommitAuthor}<br><a href=${env?.ghprbPullLink}>${github.get_short_hash()}</a>" | ||
|
||
change_identifiers.CHANGE_URL = env?.ghprbPullLink | ||
change_identifiers.CHANGE_REPO = env?.ghprbGhRepository | ||
change_identifiers.CHANGE_ID = "pull/${github.get_pr_number()}" | ||
change_identifiers.CHANGE_TARGET = env?.ghprbTargetBranch | ||
change_identifiers.CHANGE_COMMIT_HASH = env?.ghprbActualCommit | ||
change_identifiers.CHANGE_AUTHOR_DISPLAY_NAME = env?.ghprbActualCommitAuthor | ||
change_identifiers.CHANGE_AUTHOR_EMAIL = env?.ghprbActualCommitAuthorEmail | ||
change_identifiers.CHANGE_TITLE = env?.ghprbPullTitle | ||
change_identifiers.EBMC_PIPELINES_BRANCH = env.EBMC_PIPELINES_BRANCH | ||
change_identifiers += params | ||
} | ||
|
||
if (env?.RESET_CI_PROGRESS == 'true') { | ||
sh script:"""#!/bin/bash -e | ||
jf rt search ${job_build_path} | ||
jf rt delete --quiet ${job_build_path} | ||
""" | ||
} | ||
|
||
def simics_configs = [ "everest", | ||
"rainier_2s2u", | ||
"rainier_2s2u_opal_rhel", | ||
"rainier_2s4u"] | ||
|
||
// fw1060 is default | ||
def hardware_configs = ["1060-rainier", | ||
"1060-everest", | ||
"bonnell"] | ||
|
||
if (fw_level != 'fw1060') { | ||
hardware_configs = ['1050-rainier'] | ||
} | ||
|
||
def fw_config = load_ebmc_verified FW_LEVEL: fw_level | ||
|
||
// unique to pr patchset and fw level | ||
// these will be published to a | ||
|
||
def opbuild = [ AGENT: 'redhat-8 && aus.stglabs.ibm.com', // needs austin machine | ||
CONFIG: 'p10ebmc', | ||
PATCHED_REPO: change_identifiers.CHANGE_REPO, | ||
PATCHED_BRANCH: change_identifiers.CHANGE_TARGET, | ||
PATCHED_CHANGE: github.get_pr_number(), | ||
BUILD_PATH: "${job_build_path}/op-build/master-p10/p10ebmc", | ||
POST_STATUS: 'IBM op-build'] | ||
opbuild += change_identifiers | ||
|
||
def ebmc_pkg = [AGENT: 'redhat-8 && rchland.ibm.com', // closer to afs mounts | ||
CHIP: 'p10ebmc', | ||
OPBUILD_BUILD: opbuild.BUILD_PATH, | ||
EBMC_BUILD: fw_config.EBMC_BUILD, | ||
EBMC_PKG_TOOLS: fw_config.EBMC_PKG_TOOLS, | ||
BUILD_PATH: "${job_build_path}/ebmc-pkg/p10ebmc", | ||
POST_STATUS: 'IBM eBMC'] | ||
ebmc_pkg += change_identifiers | ||
|
||
def simics_jobs = [:] | ||
simics_configs.each { name -> | ||
def job_params = [:] | ||
job_params += change_identifiers | ||
job_params.MACHINE = name | ||
job_params.EBMC_BUILD = ebmc_pkg.BUILD_PATH | ||
job_params.SIMICS_BUILD = fw_config.SIMICS_BUILD | ||
job_params.SIMULATION_TEST = fw_config.SIMULATION_TEST | ||
job_params.EBMC_TEST_AUTOMATION = fw_config.EBMC_TEST_AUTOMATION | ||
job_params.OPENBMC_TEST_AUTOMATION = fw_config.OPENBMC_TEST_AUTOMATION | ||
job_params.BUILD_PATH = "${job_build_path}/simics-ci/${name}" | ||
job_params.POST_STATUS = "IBM simics ${name}" | ||
|
||
simics_jobs."${name}" = { | ||
stage("Simics ${name}") { | ||
job retry: true, | ||
job_path: "../simics-ci/${name}", | ||
parameters: job_params | ||
} | ||
} | ||
} | ||
def hardware_jobs = [:] | ||
hardware_configs.each { name -> | ||
def job_params = [:] | ||
job_params += change_identifiers | ||
job_params.MACHINE = name | ||
job_params.EBMC_BUILD = ebmc_pkg.BUILD_PATH | ||
job_params.EBMC_TEST_AUTOMATION = fw_config.EBMC_TEST_AUTOMATION | ||
job_params.OPENBMC_TEST_AUTOMATION = fw_config.OPENBMC_TEST_AUTOMATION | ||
job_params.OPENBMC_BUILD_SCRIPTS = fw_config.OPENBMC_BUILD_SCRIPTS | ||
job_params.BUILD_PATH = "${job_build_path}/hardware-ci/${name}" | ||
job_params.POST_STATUS = "IBM hardware ${name}" | ||
|
||
hardware_jobs."${name}" = { | ||
stage("Hardware ${name}") { | ||
job job_path: "../hardware-ci/${name}", | ||
parameters: job_params | ||
} | ||
} | ||
} | ||
|
||
//jf rt delete pse-jet-sys-powerfw-generic-local/open-power/op-build/master-p10/5767/b385b7ba | ||
def result = 'SUCCESS' | ||
stage("Build op-build") { | ||
|
||
job job_path: '../openpower-ci/p10ebmc', | ||
parameters: opbuild | ||
|
||
} | ||
|
||
stage("Build eBMC") { | ||
|
||
job job_path: '../ebmc-pkg/p10ebmc', | ||
parameters: ebmc_pkg | ||
|
||
} | ||
|
||
parallel simics_jobs | ||
|
||
parallel hardware_jobs | ||
|
||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
#!/usr/bin/env bash | ||
|
||
dnf makecache --refresh | ||
dnf install -y \ | ||
sshpass \ | ||
iputils \ | ||
tree \ | ||
jq \ | ||
htop \ | ||
ipmitool \ | ||
which \ | ||
openssh-server \ | ||
openssh-clients \ | ||
wget \ | ||
git \ | ||
rustc \ | ||
python3 \ | ||
vim \ | ||
cscope \ | ||
expat-devel \ | ||
patch \ | ||
zlib-devel \ | ||
zlib-static \ | ||
texinfo \ | ||
"perl(bigint)" \ | ||
"perl(XML::Simple)" \ | ||
"perl(YAML)" \ | ||
"perl(XML::SAX)" \ | ||
"perl(Fatal)" \ | ||
"perl(Thread::Queue)" \ | ||
"perl(Env)" \ | ||
"perl(XML::LibXML)" \ | ||
"perl(Digest::SHA1)" \ | ||
"perl(ExtUtils::MakeMaker)" \ | ||
"perl(FindBin)" \ | ||
"perl(English)" \ | ||
"perl(Time::localtime)" \ | ||
libxml2-devel \ | ||
unzip \ | ||
tar \ | ||
findutils \ | ||
ncurses-devel \ | ||
openssl-devel \ | ||
make \ | ||
libxslt \ | ||
vim-common \ | ||
lzo-devel \ | ||
rsync \ | ||
hostname \ | ||
flex \ | ||
bzip2 \ | ||
cpio \ | ||
gcc-c++ \ | ||
bison \ | ||
ctags \ | ||
bc \ | ||
langpacks-en \ | ||
python3-devel \ | ||
python2 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{"files": [{"pattern": "build/output_img/**/*", | ||
"target": "pse-jet-sys-powerfw-generic-local/op-build/pr-$CHANGE_ID/$BUILD_NUMBER/", | ||
"flat": "false"} | ||
]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
#!/bin/bash | ||
set -xeo pipefail | ||
|
||
# used by jenkins processes | ||
WORKSPACE=${WORKSPACE:-${HOME}} | ||
# allows user to volume mount a op-build repo | ||
opbuild_dir=${1:-${WORKSPACE}/op-build} | ||
# uses git branch name by default | ||
local_tag=${2:-op-build:pr-${CHANGE_ID}} | ||
# create unique tag for artifactory | ||
remote_tag=${3:-docker-na-public.artifactory.swg-devops.com/pse-jet-docker-local/op-build/pr-${CHANGE_ID}:${BUILD_NUMBER}} | ||
latest_tag=${4:-docker-na-public.artifactory.swg-devops.com/pse-jet-docker-local/op-build/pr-${CHANGE_ID}:latest} | ||
|
||
working_dir=/home/$USER/op-build | ||
|
||
#--no-cache | ||
podman build --build-arg UID=$UID --build-arg GID=$(id -g) --build-arg USER=$USER -t $local_tag -f ci/ibm/Dockerfile ci/ibm | ||
|
||
# start the environment in the background | ||
container_id=$(podman run -dit --userns=keep-id \ | ||
-e BUILD_NUMBER=$BUILD_NUMBER \ | ||
-e CHANGE_ID=$CHANGE_ID \ | ||
-v /home/$USER/.ssh:/home/$USER/.ssh:z \ | ||
-v /home/$USER/.jfrog:/home/$USER/.jfrog:z \ | ||
$local_tag) | ||
|
||
# copy the repo in. all files now stay inside container | ||
podman cp $opbuild_dir $container_id:$working_dir | ||
|
||
# do the compile | ||
#podman exec -w $working_dir $container_id /bin/bash -c "./op-build p10ebmc_defconfig && ./op-build" | ||
podman exec -w $working_dir $container_id /bin/bash -c "./op-build p10ebmc_defconfig" | ||
|
||
# Upload build images to artifactory | ||
podman exec -w $working_dir $container_id /bin/bash -c "./ci/ibm/upload_artifactory.sh" | ||
podman cp $container_id:$working_dir/upload.log $WORKSPACE | ||
echo "Browse https://na-public.artifactory.swg-devops.com/ui/native/pse-jet-sys-powerfw-generic-local/op-build/pr-$CHANGE_ID/$BUILD_NUMBER" | ||
|
||
|
||
# create unique tag for artifactory | ||
podman commit $container_id $remote_tag | ||
podman tag $remote_tag $latest_tag | ||
|
||
# push to artifactory to save this version of the environment | ||
podman push $remote_tag | ||
podman push $latest_tag | ||
echo "Browse tags https://na-public.artifactory.swg-devops.com/ui/native/pse-jet-docker-local/op-build/pr-$CHANGE_ID" | ||
|
||
echo "To recreate podman run -itd --userns=keep-id --user hostboot -v /home/$USER/.ssh:/home/$USER/.ssh:z -v /home/$USER/.jfrog:/home/$USER/.jfrog:z -w $working_dir $remote_tag" | ||
|
||
|
||
start_time=$(date +%s) | ||
# Stop and remove the container upon successful run | ||
podman stop $container_id | ||
end_time=$(date +%s) | ||
echo "podman stop took $(($end_time-$start_time)) seconds" >> timings.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/bash | ||
set -xeo pipefail | ||
|
||
# allows user to volume mount a op-build repo | ||
opbuild_dir=${1:-${HOME}/op-build} | ||
# uses git branch name by default | ||
tag_name=${2:-op-build:$(git rev-parse --abbrev-ref HEAD)} | ||
|
||
working_dir=/home/$USER/op-build | ||
#exit | ||
# | ||
podman build --build-arg UID=$UID --build-arg GID=$(id -g) --build-arg USER=$USER -t $tag_name -f ci/ibm/Dockerfile ci/ibm | ||
|
||
# mount the local repo into the container | ||
# mount ssh keys for additional cloning if required | ||
container_id=$(podman run -itd --userns=keep-id \ | ||
-v $opbuild_dir:$working_dir:z \ | ||
-v /home/$USER/.ssh:/home/$USER/.ssh:z \ | ||
-w $working_dir $tag_name) | ||
|
||
# do the compile | ||
#podman exec -w $working_dir $container_id /bin/bash -c "./op-build p10ebmc_defconfig && ./op-build" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#!/bin/bash -x | ||
|
||
OS="fedora" | ||
agent_os="FEDORA" | ||
CONFIG="p10ebmc" | ||
export FROG_CLI_LOG_LEVEL='ERROR' | ||
|
||
####### OUTPUT RE-DIRECTION ####### | ||
|
||
# Define some variables | ||
op_build_path=$HOME/op-build | ||
origin=$op_build_path/output | ||
destination=$HOME/op-build/build/output_img/$agent_os/$CONFIG/output | ||
powerpc_dir="$destination/host/powerpc64le-buildroot-linux-gnu/sysroot" | ||
|
||
# Make needed directories | ||
mkdir -p $destination/images | ||
mkdir -p $powerpc_dir/openpower_pnor_scratch | ||
mkdir -p $powerpc_dir/sbe_sim_data | ||
|
||
# Copy required files | ||
cp $origin/images/*.pnor $destination/images/ | ||
cp $origin/images/*.pnor.ubi.mtd $destination/images/ | ||
cp $origin/images/*.pnor.squashfs.tar $destination/images/ | ||
cp $origin/images/*ebmc_lids.tar.gz $destination/images/ | ||
|
||
# hostboot simics files + tools | ||
cp $origin/images/host_fw_debug.tar $destination/images | ||
cp $origin/images/sim/hostboot_sim.tar $destination/images | ||
|
||
# only need the tar.gz and uncompress when needed? | ||
cp $origin/images/mmc.tar.gz $destination/images | ||
cp -r $origin/images/mmc $destination/images | ||
|
||
# for opal | ||
cp $origin/host/powerpc64le-buildroot-linux-gnu/sysroot/openpower_pnor_scratch/BOOTKERNEL.bin $powerpc_dir/openpower_pnor_scratch | ||
|
||
# sbe simics files + tools | ||
# this is a directory, get all of it. not expecting any child directories | ||
cp $origin/host/powerpc64le-buildroot-linux-gnu/sysroot/sbe_sim_data/* $powerpc_dir/sbe_sim_data | ||
|
||
# .config | ||
cp $origin/.config $op_build_path/build/output_img/$agent_os/$CONFIG/p10ebmc.config | ||
|
||
# upload to artifactory | ||
echo "{\"files\": [{\"pattern\": \"build/output_img/**/*\", \"target\": \"pse-jet-sys-powerfw-generic-local/op-build/pr-$CHANGE_ID/$BUILD_NUMBER/\", \"flat\": \"false\"}]}" > ci/ibm/p10ebmc_upload_spec.txt | ||
|
||
jf rt u --spec=ci/ibm/p10ebmc_upload_spec.txt >> upload.log | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about renaming
ibm/Dockerfile
toibm/Containerfile
? IMHO theContainerfile
is a better choice just because we are not usingdocker
at all here