-
Notifications
You must be signed in to change notification settings - Fork 35
Build dockers #1298
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
Merged
Merged
Build dockers #1298
Changes from all commits
Commits
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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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,66 @@ | ||
# Copyright (C) 2025 Intel Corporation | ||
# Under the Apache License v2.0 with LLVM Exceptions. See LICENSE.TXT. | ||
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
|
||
# | ||
# Dockerfile - a 'recipe' for Docker to build an image of ubuntu-based | ||
# environment for building the Unified Memory Framework project. | ||
# | ||
|
||
# Pull base image ("24.04") | ||
FROM registry.hub.docker.com/library/ubuntu@sha256:72297848456d5d37d1262630108ab308d3e9ec7ed1c3286a32fe09856619a782 | ||
|
||
# Set environment variables | ||
ENV OS ubuntu | ||
ENV OS_VER 24.04 | ||
ENV NOTTY 1 | ||
ENV DEBIAN_FRONTEND noninteractive | ||
|
||
# Base development packages | ||
ARG BASE_DEPS="\ | ||
build-essential \ | ||
cmake \ | ||
git \ | ||
wget" | ||
|
||
# UMF's dependencies | ||
ARG UMF_DEPS="\ | ||
libhwloc-dev" | ||
|
||
# Dependencies for tests (optional) | ||
ARG TEST_DEPS="\ | ||
libnuma-dev \ | ||
libtbb-dev \ | ||
valgrind" | ||
|
||
# Miscellaneous for our builds/CI (optional) | ||
ARG MISC_DEPS="\ | ||
automake \ | ||
clang \ | ||
lcov \ | ||
python3-pip \ | ||
sudo \ | ||
whois" | ||
|
||
# Update and install required packages | ||
RUN apt-get update \ | ||
&& apt-get install -y --no-install-recommends \ | ||
${BASE_DEPS} \ | ||
${TEST_DEPS} \ | ||
${MISC_DEPS} \ | ||
${UMF_DEPS} \ | ||
&& rm -rf /var/lib/apt/lists/* \ | ||
&& apt-get clean all | ||
|
||
# Prepare a dir (accessible by anyone) | ||
RUN mkdir -p --mode 777 /opt/umf/ | ||
|
||
# Additional dependencies (installed via pip) | ||
COPY third_party/requirements.txt /opt/umf/requirements.txt | ||
RUN pip3 install --no-cache-dir --break-system-packages -r /opt/umf/requirements.txt | ||
|
||
# Add a new (non-root) 'test_user' | ||
ENV USER test_user | ||
ENV USERPASS pass | ||
RUN useradd -m "${USER}" -g sudo -p "$(mkpasswd ${USERPASS})" | ||
USER test_user |
This file contains hidden or 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,44 @@ | ||
name: DetectChanges | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- '.github/docker/*.Dockerfile' | ||
lukaszstolarczuk marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- '.github/scripts/*' | ||
push: | ||
paths: | ||
- '.github/docker/*.Dockerfile' | ||
- '.github/scripts/*' | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
DetectChanges: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
changed_files: ${{ steps.changed-files.outputs.all_changed_files }} | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Get changed files | ||
id: changed-files | ||
uses: tj-actions/changed-files@ed68ef82c095e0d48ec87eccea555d944a631a4c #v46.0.5 | ||
|
||
- name: List all changed files | ||
env: | ||
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }} | ||
run: | | ||
echo "Changed files: $ALL_CHANGED_FILES" | ||
|
||
BuildDocker: | ||
needs: DetectChanges | ||
if: ${{ contains(join(needs.DetectChanges.outputs.changed_files, ' '), '.github/docker/') }} | ||
uses: ./.github/workflows/reusable_dockers_build.yml | ||
permissions: | ||
contents: read | ||
packages: write | ||
secrets: inherit |
This file contains hidden or 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,42 @@ | ||
# Build and push Docker images to GHCR | ||
name: BuildDockers | ||
|
||
on: | ||
workflow_call: | ||
workflow_dispatch: | ||
|
||
permissions: | ||
packages: write | ||
contents: read | ||
|
||
jobs: | ||
build-dockers: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
os: [ubuntu-20.04, ubuntu-22.04, ubuntu-24.04] | ||
env: | ||
IMG: ghcr.io/bb-ur/umf-${{ matrix.os }}:latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Build ${{ matrix.os }} Docker image | ||
run: | | ||
docker build -f .github/docker/${{ matrix.os }}.Dockerfile -t ${{ env.IMG }} . | ||
|
||
- name: Login to GitHub Container Registry | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@30f019fb76bb54d03ec1e716054622be511a13b2 # v3.2.0 | ||
with: | ||
registry: ghcr.io | ||
username: bb-ur | ||
password: ${{ secrets.BB_GHCR_TOKEN }} | ||
|
||
- name: Push ${{ matrix.os }} Docker image | ||
if: github.event_name != 'pull_request' | ||
run: | | ||
docker push ${{ env.IMG }} |
This file contains hidden or 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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.