Skip to content

Innovations and code projects that share ChatGPT information, libraries, and code/cloud usage patterns to simplify, bring joy and superpowers to customers.

Notifications You must be signed in to change notification settings

AaronCWacker/ChatGPT-Innovations-2023

Repository files navigation

Docker Starter Projects for AI:

  1. Streamlit: https://huggingface.co/spaces/DockerTemplates/streamlit-docker-example
  2. Gradio: https://huggingface.co/spaces/sayakpaul/demo-docker-gradio
  3. HTTP w GO: https://huggingface.co/spaces/XciD/test-docker-go?q=Adrien
  4. Secrets: https://huggingface.co/spaces/DockerTemplates/secret-example
  5. Fast API: https://huggingface.co/spaces/DockerTemplates/fastapi_t5

Github Actions Deploy to ACA:

πŸ‹ Create a Dockerfile for Gradio deployment πŸ‹

1️⃣ Start by specifying the base image for your container. For Python:

FROM python:3.8-slim-buster

2️⃣ Set the working directory for the container and copy the necessary files:

WORKDIR /app COPY . /app

3️⃣ Install the necessary dependencies, including Gradio:

RUN pip install --upgrade pip &&
pip install gradio

4️⃣ Specify the command to run when the container starts:

CMD ["python", "app.py"]

πŸš€ Build and push your container image to Azure Container Registry πŸš€

πŸ“— Set up a GitHub Actions workflow for deployment πŸ“—

Use azure/login action for Azure authentication and azure/container-apps-deploy-action for deployment. Provide necessary inputs like container app name, Azure Container Registry name, and container image tag.

Here's an example GitHub Actions workflow: name: Deploy to Azure Container Apps

on: push: branches: - main

env: AZURE_CONTAINER_APP_NAME: AZURE_CONTAINER_REGISTRY_NAME: IMAGE_TAG: ${{ github.sha }}

jobs: deploy: runs-on: ubuntu-latest steps: - name: Check out code uses: actions/checkout@v2

  • name: Login to Azure uses: azure/login@v1 with: creds: ${{ secrets.AZURE_CREDENTIALS }}

  • name: Deploy to Azure Container Apps uses: azure/container-apps-deploy-action@v1 with: containerAppName: e n v . A Z U R E C O N T A I N E R A P P N A M E i m a g e N a m e : {{ env.AZURE_CONTAINER_REGISTRY_NAME }}.azurecr.io/myimage:${{ env.IMAGE_TAG }}

▢️ After your GitHub Actions workflow is set up, follow these steps to get your app running on Azure Container Apps ▢️

5️⃣ Commit and push your changes πŸ“

Once you've made all necessary changes to your Dockerfile and GitHub Actions workflow file, commit and push them to your repository.

git add .
git commit -m "Setup Dockerfile and GitHub Actions workflow"
git push origin main
6️⃣ Watch your GitHub Actions workflow πŸ‘€

Go to the "Actions" tab in your GitHub repository to see your workflow in action. If everything is set up correctly, you should see your workflow running and completing without errors.

7️⃣ Check your app on Azure Container Apps 🏁

Once the GitHub Actions workflow has completed, your app should be deployed to Azure Container Apps. You can check the status of your app in the Azure portal.

8️⃣ Enjoy your Gradio app running smoothly on Azure Container Apps πŸŽ‰

You've successfully deployed your Gradio app to Azure Container Apps using a Docker container and GitHub Actions!

About

Innovations and code projects that share ChatGPT information, libraries, and code/cloud usage patterns to simplify, bring joy and superpowers to customers.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published