-
Notifications
You must be signed in to change notification settings - Fork 70
[Docker] add downloader and runtime Dockerfiles with build instructions #381
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
Open
zhiweideren
wants to merge
6
commits into
volcano-sh:main
Choose a base branch
from
zhiweideren:mergePythonDockerfile
base: main
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
Changes from 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
ea98664
[Docker] add downloader and runtime Dockerfiles with build instructions
zhiweideren 0d86737
[Docker] add downloader and runtime Dockerfiles with build instructions
zhiweideren 9a73733
[Docker] add downloader and runtime Dockerfiles with build instructions
zhiweideren 1ae0e99
makefile generate fix
zhiweideren f45e27a
makefile generate fix
zhiweideren c002cda
makefile generate fix
zhiweideren 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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,108 @@ | ||
| name: Build and Push Docker Images | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: | ||
| - main | ||
| paths: | ||
| - "docker/**" | ||
| - "python/**" | ||
| push: | ||
| branches: | ||
| - main | ||
| tags: | ||
| - "v*.*.*" | ||
| paths: | ||
| - '**.go' | ||
| - "pkg/**" | ||
| - "cmd/**" | ||
| - "go.mod" | ||
| - "go.sum" | ||
| - 'python/**' | ||
|
|
||
| jobs: | ||
| build-go: | ||
| if: github.repository == 'volcano-sh/kthena' && (github.event_name != 'pull_request' || contains(github.event.pull_request.changed_files, 'docker/') || contains(github.event.pull_request.changed_files, '**.go') || contains(github.event.pull_request.changed_files, 'pkg/') || contains(github.event.pull_request.changed_files, 'cmd/') || contains(github.event.pull_request.changed_files, 'go.mod') || contains(github.event.pull_request.changed_files, 'go.sum')) | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| service: | ||
| - kthena-router | ||
| - kthena-controller-manager | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v5 | ||
|
|
||
| - name: Extract Docker image metadata | ||
| id: meta | ||
| uses: docker/metadata-action@v5 | ||
| with: | ||
| images: ghcr.io/${{ github.repository_owner }}/${{ matrix.service }} | ||
| tags: | | ||
| type=ref,event=branch | ||
| type=semver,pattern={{version}} | ||
| type=raw,value=latest,enable={{is_default_branch}} | ||
|
|
||
| - name: Log in to Github Container Registry | ||
| uses: docker/login-action@v3 | ||
| if: github.event_name != 'pull_request' | ||
| with: | ||
| registry: ghcr.io | ||
| username: ${{ github.actor }} | ||
| password: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v3 | ||
|
|
||
| - name: Build and push Docker image | ||
| uses: docker/build-push-action@v6 | ||
| with: | ||
| context: . | ||
| file: ./docker/Dockerfile.${{ matrix.service }} | ||
| push: ${{ github.event_name != 'pull_request' }} | ||
| tags: ${{ steps.meta.outputs.tags }} | ||
| annotations: ${{ steps.meta.outputs.annotations }} | ||
| provenance: true | ||
| sbom: true | ||
|
|
||
| build-python: | ||
| if: github.repository == 'volcano-sh/kthena' && (github.event_name != 'pull_request' || contains(github.event.pull_request.changed_files, 'docker/Dockerfile.downloader') || contains(github.event.pull_request.changed_files, 'docker/Dockerfile.runtime') || contains(github.event.pull_request.changed_files, 'python/')) | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| service: [ downloader, runtime ] | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v5 | ||
|
|
||
| - name: Extract Docker image metadata | ||
| id: meta | ||
| uses: docker/metadata-action@v5 | ||
| with: | ||
| images: ghcr.io/${{ github.repository_owner }}/${{matrix.service}} | ||
| tags: | | ||
| type=ref,event=branch | ||
| type=semver,pattern={{version}} | ||
| type=raw,value=latest,enable={{is_default_branch}} | ||
|
|
||
| - name: Log in to Github Container Registry | ||
| uses: docker/login-action@v3 | ||
| if: github.event_name != 'pull_request' | ||
| with: | ||
| registry: ghcr.io | ||
| username: ${{ github.actor }} | ||
| password: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v3 | ||
|
|
||
| - name: Build and push Docker image | ||
| uses: docker/build-push-action@v6 | ||
| with: | ||
| context: . | ||
| file: ./docker/Dockerfile.${{ matrix.service }} | ||
| push: ${{ github.event_name != 'pull_request' }} | ||
| tags: ${{ steps.meta.outputs.tags }} | ||
| annotations: ${{ steps.meta.outputs.annotations }} | ||
| provenance: true | ||
| sbom: true |
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
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,27 @@ | ||
| # Build the manager binary | ||
| FROM python:3.12-slim | ||
|
|
||
| RUN apt-get update && \ | ||
| apt-get install -y curl unzip rsync && \ | ||
| apt-get clean && \ | ||
| rm -rf /var/lib/apt/lists/* | ||
|
|
||
| RUN set -ex && \ | ||
| ARCH=$(uname -m) && \ | ||
| if [ "$ARCH" = "x86_64" ]; then \ | ||
| curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"; \ | ||
| elif [ "$ARCH" = "aarch64" ]; then \ | ||
| curl "https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip" -o "awscliv2.zip"; \ | ||
| else \ | ||
| echo "Unsupported architecture: $ARCH" && exit 1; \ | ||
| fi && \ | ||
| unzip awscliv2.zip && \ | ||
| ./aws/install && \ | ||
| rm -rf awscliv2.zip aws | ||
|
|
||
| WORKDIR /app | ||
| COPY python/kthena/downloader/requirements.txt . | ||
| RUN pip install --no-cache-dir -r requirements.txt | ||
| COPY python/kthena/downloader/ ./kthena/downloader/ | ||
| ENV PYTHONPATH="/app" | ||
| ENTRYPOINT ["python", "kthena/downloader/app.py"] | ||
zhiweideren marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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,26 @@ | ||
| # Build the manager binary | ||
| FROM python:3.12-slim | ||
| RUN apt-get update && \ | ||
| apt-get install -y curl unzip rsync && \ | ||
| apt-get clean && \ | ||
| rm -rf /var/lib/apt/lists/* | ||
|
|
||
| RUN set -ex && \ | ||
| ARCH=$(uname -m) && \ | ||
| if [ "$ARCH" = "x86_64" ]; then \ | ||
| curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"; \ | ||
| elif [ "$ARCH" = "aarch64" ]; then \ | ||
| curl "https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip" -o "awscliv2.zip"; \ | ||
| else \ | ||
| echo "Unsupported architecture: $ARCH" && exit 1; \ | ||
| fi && \ | ||
| unzip awscliv2.zip && \ | ||
| ./aws/install && \ | ||
| rm -rf awscliv2.zip aws | ||
|
|
||
| WORKDIR /app | ||
| COPY python/kthena/downloader/ ./kthena/downloader/ | ||
| COPY python/kthena/runtime/ ./kthena/runtime/ | ||
| RUN pip install --no-cache-dir -r kthena/runtime/requirements.txt | ||
| ENV PYTHONPATH="/app" | ||
| ENTRYPOINT ["python","kthena/runtime/app.py"] | ||
zhiweideren marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
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.
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.
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.
This is duplicate with @git-malu 's pr
Uh oh!
There was an error while loading. Please reload this page.
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.
yes,ci error. I executed "make generate" based on the latest main branch, and it was auto - generated.