Spaces:
Runtime error
Runtime error
Joshua Sundance Bailey
commited on
Commit
·
d8ffc32
1
Parent(s):
565cad2
refactor
Browse files
.github/workflows/push.yml
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
name: Build, Deploy
|
| 2 |
+
|
| 3 |
+
on:
|
| 4 |
+
push:
|
| 5 |
+
branches: [main]
|
| 6 |
+
workflow_dispatch:
|
| 7 |
+
|
| 8 |
+
jobs:
|
| 9 |
+
build-and-push-docker:
|
| 10 |
+
runs-on: ubuntu-latest
|
| 11 |
+
steps:
|
| 12 |
+
- uses: actions/checkout@v2
|
| 13 |
+
with:
|
| 14 |
+
fetch-depth: 0
|
| 15 |
+
token: ${{ secrets.WORKFLOW_GIT_ACCESS_TOKEN }}
|
| 16 |
+
|
| 17 |
+
- name: Build Docker image
|
| 18 |
+
run: docker build -t joshuasundance/langchain-streamlit-demo .
|
| 19 |
+
|
| 20 |
+
- name: Log in to Docker Hub
|
| 21 |
+
uses: docker/login-action@v1
|
| 22 |
+
with:
|
| 23 |
+
username: joshuasundance
|
| 24 |
+
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
| 25 |
+
|
| 26 |
+
- name: Push to Docker Hub
|
| 27 |
+
run: docker push joshuasundance/langchain-streamlit-demo:latest
|
| 28 |
+
|
| 29 |
+
push-to-huggingface:
|
| 30 |
+
needs: build-and-push-docker
|
| 31 |
+
runs-on: ubuntu-latest
|
| 32 |
+
steps:
|
| 33 |
+
- uses: actions/checkout@v2
|
| 34 |
+
with:
|
| 35 |
+
fetch-depth: 0
|
| 36 |
+
token: ${{ secrets.WORKFLOW_GIT_ACCESS_TOKEN }}
|
| 37 |
+
|
| 38 |
+
- name: Push to HuggingFace Space
|
| 39 |
+
env:
|
| 40 |
+
HF_TOKEN: ${{ secrets.HF_TOKEN }}
|
| 41 |
+
run: |
|
| 42 |
+
git push https://joshuasundance:$HF_TOKEN@huggingface.co/spaces/joshuasundance/langchain-streamlit-demo main
|
Dockerfile
CHANGED
|
@@ -8,7 +8,12 @@ ENV PYTHONDONTWRITEBYTECODE=1 \
|
|
| 8 |
PATH="/home/appuser/.local/bin:$PATH"
|
| 9 |
|
| 10 |
RUN pip install --user --upgrade pip
|
| 11 |
-
COPY ./requirements.txt /home/appuser/
|
| 12 |
-
RUN pip install --user -r /home/appuser/
|
| 13 |
|
| 14 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
PATH="/home/appuser/.local/bin:$PATH"
|
| 9 |
|
| 10 |
RUN pip install --user --upgrade pip
|
| 11 |
+
COPY ./requirements.txt /home/appuser/requirements.txt
|
| 12 |
+
RUN pip install --user -r /home/appuser/requirements.txt
|
| 13 |
|
| 14 |
+
COPY ./langchain-streamlit-demo/* /home/appuser/langchain-streamlit-demo/
|
| 15 |
+
|
| 16 |
+
WORKDIR /home/appuser/langchain-streamlit-demo
|
| 17 |
+
EXPOSE 7860
|
| 18 |
+
|
| 19 |
+
CMD ["python", "-m", "streamlit", "run", "/home/appuser/langchain-streamlit-demo/app.py", "--server.port", "7860", "--server.address", "0.0.0.0"]
|
docker-compose.yml
CHANGED
|
@@ -5,14 +5,11 @@ services:
|
|
| 5 |
image: streamlit-chat:latest
|
| 6 |
build: .
|
| 7 |
ports:
|
| 8 |
-
- "
|
| 9 |
-
volumes:
|
| 10 |
-
- .:/home/appuser/app:rw
|
| 11 |
-
working_dir: /home/appuser/app/
|
| 12 |
command: [
|
| 13 |
"python", "-m",
|
| 14 |
"streamlit", "run",
|
| 15 |
-
"/home/appuser/
|
| 16 |
-
"--server.port", "
|
| 17 |
"--server.address", "0.0.0.0"
|
| 18 |
]
|
|
|
|
| 5 |
image: streamlit-chat:latest
|
| 6 |
build: .
|
| 7 |
ports:
|
| 8 |
+
- "${APP_PORT:-7860}:${APP_PORT:-7860}"
|
|
|
|
|
|
|
|
|
|
| 9 |
command: [
|
| 10 |
"python", "-m",
|
| 11 |
"streamlit", "run",
|
| 12 |
+
"/home/appuser/langchain-streamlit-demo/app.py",
|
| 13 |
+
"--server.port", "${APP_PORT:-7860}",
|
| 14 |
"--server.address", "0.0.0.0"
|
| 15 |
]
|
{.streamlit → langchain-streamlit-demo/.streamlit}/config.toml
RENAMED
|
File without changes
|