Skip to content
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

ci : fix docker build number and tag name #9638

Merged
merged 2 commits into from
Sep 25, 2024

Conversation

ngxson
Copy link
Collaborator

@ngxson ngxson commented Sep 25, 2024

Motivation

Currently, docker build (both from CI and locally via docker build) outputs build 0 when asking with --version

# docker run --rm ghcr.io/ggerganov/llama.cpp:server --version
version: 0 (unknown)
built with cc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0 for x86_64-linux-gnu

This is due to .git being included inside .dockerignore, which make the directory not being copied into docker build context.

The CI also have a problem where tag name becomes :full-cuda--b1-1e43630, while ideally it should be something like :full-cuda-b1234

In this PR

  • Remove .git from .dockerignore
  • For CI, each build on master branch will now have 2 tags:
    • :${{ matrix.config.tag }} --> example: :full-cuda
    • :${{ matrix.config.tag }}-b${BUILD_NUMBER} --> example: :full-cuda-b1234

Test

For testing purpose, I created a cloned repo: https://github.com/ngxson/llama.cpp-fix-ci/pkgs/container/llama.cpp-fix-ci/versions

For testing locally:

docker build -f ./.devops/llama-server.Dockerfile .
docker run --rm llamacpptest --version
# version: 3830 (6513c323)

# Fine-grant permission
# https://docs.github.com/en/actions/security-for-github-actions/security-guides/automatic-token-authentication#modifying-the-permissions-for-the-github_token
permissions:
packages: write
Copy link
Collaborator Author

@ngxson ngxson Sep 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ggerganov Small explanation for this: This allow disabling global write access for GITHUB_TOKEN on CI (image below)

However, some other workflows don't support this yet (for example, build.yml), so let's keep the read-write setting for now. I'll do a follow-up PR for fixing it.

image

@github-actions github-actions bot added the devops improvements to build systems and github actions label Sep 25, 2024
@ngxson ngxson merged commit ea9c32b into ggerganov:master Sep 25, 2024
7 checks passed
@ngxson ngxson mentioned this pull request Oct 1, 2024
2 tasks
dsx1986 pushed a commit to dsx1986/llama.cpp that referenced this pull request Oct 29, 2024
* ci : fix docker build number and tag name

* fine-grant permissions
arthw pushed a commit to arthw/llama.cpp that referenced this pull request Nov 15, 2024
* ci : fix docker build number and tag name

* fine-grant permissions
arthw pushed a commit to arthw/llama.cpp that referenced this pull request Nov 18, 2024
* ci : fix docker build number and tag name

* fine-grant permissions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
devops improvements to build systems and github actions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants