Skip to content

Commit

Permalink
circle-ci
Browse files Browse the repository at this point in the history
  • Loading branch information
luzfcb committed Dec 22, 2024
1 parent 37fb1c5 commit fa99482
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 4 deletions.
58 changes: 58 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
version: 2.1

jobs:
build-and-push:
# Define a parameter (tag-name) with a default of "v2"
parameters:
tag-name:
type: string
default: "v2"
docker:
- image: cimg/base:stable
environment:
DOCKER_BUILDKIT: 1
steps:
- checkout

- run:
name: Show disk usage (1st time)
command: |
df -h
- run:
name: Pull base GPU image (from Dockerfile.cuda12)
command: |
BASE_GPU_IMAGE=$(awk '/^FROM / {print $2}' Dockerfile.cuda12)
echo "Base GPU image found: $BASE_GPU_IMAGE"
echo "Pulling Docker image: $BASE_GPU_IMAGE"
docker pull "$BASE_GPU_IMAGE"
- run:
name: Show disk usage (2nd time)
command: |
df -h
- run:
name: Build Docker image (no-cache)
command: |
echo "Building Docker image with tag: << parameters.tag-name >>"
docker build \
--platform linux/amd64 \
-f Dockerfile.cuda12 \
-t "luzfcb/aio-local-ai-cuda12:<< parameters.tag-name >>" \
.
# - run:
# name: Push Docker image to Docker Hub
# command: |
# # Assumes you've set DOCKERHUB_USERNAME and DOCKERHUB_PASSWORD as environment variables in CircleCI
# echo "$DOCKERHUB_PASSWORD" | docker login -u "$DOCKERHUB_USERNAME" --password-stdin
# echo "Pushing image: luzfcb/aio-local-ai-cuda12:<< parameters.tag-name >>"
# docker push "luzfcb/aio-local-ai-cuda12:<< parameters.tag-name >>"


workflows:
build-and-push-workflow:
jobs:
- build-and-push:
tag-name: "v2" # OPTIONAL: override default if desired
10 changes: 6 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@ services:

cuda12:
build:
context: .
dockerfile: Dockerfile.cuda12
image: szaimen/aio-local-ai-cuda12:v2
platforms:
- linux/amd64
context: .
dockerfile: Dockerfile.cuda12
image: luzfcb/aio-local-ai-cuda12:v2
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
capabilities: [gpu]

0 comments on commit fa99482

Please sign in to comment.