A (very) simple, text only chatbot using Society AI inference endpoint
Update .gitea/workflows/gradio-text-chatbot.yaml
All checks were successful
society-ai-hub-container-cache Actions Demo / build (push) Successful in 26s
All checks were successful
society-ai-hub-container-cache Actions Demo / build (push) Successful in 26s
This commit is contained in:
parent
de8c208c06
commit
89e699cb56
@ -1,32 +1,43 @@
|
|||||||
# Use a slim base image to reduce potential vulnerabilities
|
name: society-ai-hub-container-cache Actions Demo
|
||||||
FROM python:3.10-slim-bookworm
|
run-name: ${{ society-ai-hub-container-cache.actor }} is building an AI Application 🚀
|
||||||
|
on:
|
||||||
|
repository_dispatch:
|
||||||
|
types:
|
||||||
|
- created
|
||||||
|
|
||||||
# Create a non-root user and group with home directory set to /usr/src/app
|
push:
|
||||||
RUN useradd --no-log-init -r -m -d /usr/src/app appuser
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
# Set the working directory
|
jobs:
|
||||||
WORKDIR /usr/src/app
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
# Copy the requirements file and install the dependencies as root
|
steps:
|
||||||
COPY requirements.txt .
|
- name: Login to ECR
|
||||||
|
uses: docker/login-action@v3
|
||||||
RUN pip install --no-cache-dir uv==0.4.28 && \
|
with:
|
||||||
pip install --no-cache-dir -r requirements.txt
|
registry: ${{ vars.ECR_REGISTRY }}
|
||||||
|
- name: configure AWS Credentials
|
||||||
# Copy the application code and set ownership to appuser
|
uses: aws-actions/configure-aws-credentials@v4
|
||||||
COPY . .
|
with:
|
||||||
|
aws-region: ${{ vars.AWS_REGION }}
|
||||||
# Change ownership of the application directory to appuser
|
- name: Set up QEMU
|
||||||
RUN chown -R appuser:appuser /usr/src/app
|
uses: https://github.com/actions/checkout@v4
|
||||||
|
- name: Set up Docker Buildx
|
||||||
# Switch to the non-root user
|
uses: docker/setup-buildx-action@v3
|
||||||
USER appuser
|
- name: Build and push Docker image
|
||||||
|
id: docker_build
|
||||||
# Expose the application port
|
uses: docker/build-push-action@v5
|
||||||
EXPOSE 7860
|
with:
|
||||||
|
context: .
|
||||||
# Set environment variables
|
file: ./Dockerfile
|
||||||
ENV GRADIO_SERVER_NAME="0.0.0.0"
|
push: true
|
||||||
|
platforms: "linux/amd64"
|
||||||
# Run the application
|
tags: "${{ vars.ECR_REGISTRY }}/gradio-app:${{ env.REPOSITORY_UUID }}"
|
||||||
CMD ["python", "app.py"]
|
# cache-from: type=s3,region=${{ vars.AWS_REGION }},bucket=society-ai-hub-container-cache,mode=max
|
||||||
|
# cache-to: type=s3,region=${{ vars.AWS_REGION }},bucket=society-ai-hub-container-cache,mode=max,compress=true
|
||||||
|
cache-from: type=local,src=/tmp/
|
||||||
|
cache-to: type=local,dest=/tmp/
|
||||||
|
- name: Deploy App
|
||||||
|
run: |
|
||||||
|
helm -n default upgrade --install ${{ env.REPOSITORY_UUID }} /charts/gradio-app --set imageDigest=${{ steps.docker_build.outputs.digest }} --set uuid=${{ env.REPOSITORY_UUID }}
|
Loading…
x
Reference in New Issue
Block a user