Skip to content

Commit

Permalink
📦️ Provide mechanism to build HF Cli image
Browse files Browse the repository at this point in the history
  • Loading branch information
alvarolop committed Nov 19, 2024
1 parent 1da4a07 commit 3736a64
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/hf-cli-push-quay.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: hf-cli-push-quay

run-name: Build and Push HF CLI Container image to Quay.io🚀

env:
IMAGE_BASE_NAME: "quay.io/alopezme/hf-cli"


# This section ensures that new pushes cancel current executions of the workflow
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true

on:
# schedule:
# - cron: '0 10 * * *'
push:
paths:
- 'dockerfiles/**'
- '.github/workflows/hf-cli-push-quay.yml'

jobs:
build-and-push-image:
runs-on: ubuntu-latest
name: "Build AWS-OC Image"
steps:

- name: Checkout the code
uses: actions/checkout@v4

- name: Login to Quay.io
uses: docker/login-action@v3
with:
registry: quay.io
username: ${{ secrets.QUAY_REPO_USERNAME }}
password: ${{ secrets.QUAY_REPO_TOKEN }}

- name: Build and push image
uses: docker/build-push-action@v6
with:
push: true
context: .
file: dockerfile-aws/Dockerfile
tags: ${{ env.IMAGE_BASE_NAME }}:latest
15 changes: 15 additions & 0 deletions dockerfiles/hf-cli/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM registry.access.redhat.com/ubi9-minimal:latest

# Install dependencies
RUN microdnf install -y unzip pip \
&& microdnf clean all

# Install huggingface hub cli without cache directory
RUN pip install --no-cache-dir -U "huggingface_hub[cli]" && \
rm -rf /root/.cache

# Install AWS CLI
RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" \
&& unzip awscliv2.zip \
&& rm -rf awscliv2.zip \
&& ./aws/install

0 comments on commit 3736a64

Please sign in to comment.