This repository has been archived by the owner on Sep 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Attempting Ploomber cloud deployment.
- Loading branch information
1 parent
b8533a9
commit 04060b8
Showing
5 changed files
with
104 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: Ploomber Cloud | ||
|
||
on: | ||
push: | ||
branches: | ||
# only deploy from the main branch | ||
- main | ||
|
||
jobs: | ||
deploy-to-ploomber-cloud: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.12' | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install ploomber-cloud | ||
- name: Deploy | ||
env: | ||
PLOOMBER_CLOUD_KEY: ${{ secrets.PLOOMBER_CLOUD_KEY }} | ||
LANGFUSE_PUBLIC_KEY: ${{ secrets.LANGFUSE_PUBLIC_KEY }} | ||
LANGFUSE_SECRET_KEY: ${{ secrets.LANGFUSE_SECRET_KEY }} | ||
run: | | ||
ploomber-cloud deploy --watch-incremental | ||
# The --watch-incremental flag will print deployment status and deployment | ||
# log updates to the GitHub logs. | ||
# To learn more, visit: https://docs.cloud.ploomber.io/en/latest/user-guide/github.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# Copyright 2024 Anirban Basu | ||
|
||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
|
||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# Pull Python 3.12 on Debian Bookworm slim image | ||
FROM python:3.12.3-slim-bookworm | ||
|
||
# Upgrade and install basic packages | ||
RUN apt-get update && apt-get -y upgrade && apt-get -y dist-upgrade && apt-get -y install nano build-essential | ||
|
||
# Set the working directory in the container | ||
WORKDIR /app | ||
|
||
# Copy only the requirements file to take advantage of layering (see: https://docs.cloud.ploomber.io/en/latest/user-guide/dockerfile.html) | ||
COPY ./requirements.txt ./ | ||
|
||
# Setup Virtual environment | ||
RUN python -m venv /app/venv | ||
RUN /app/venv/bin/python -m ensurepip | ||
RUN /app/venv/bin/pip install --no-cache --upgrade pip setuptools | ||
|
||
ENV PATH="/app/venv/bin:$PATH" | ||
ENV VIRTUAL_ENV="/app/venv" | ||
|
||
# Install dependencies | ||
RUN /app/venv/bin/pip install -r requirements.txt --no-cache-dir | ||
|
||
# Copy the project files | ||
COPY ./*.md ./LICENSE ./ | ||
COPY ./*.sh ./ | ||
RUN chmod +x *.sh | ||
COPY ./.env.docker ./.env | ||
COPY ./*.py ./ | ||
COPY ./pages/*.py ./pages/ | ||
COPY ./utils/*.py ./utils/ | ||
|
||
# Expose the port to conect | ||
EXPOSE 8765 | ||
# Run the application | ||
ENTRYPOINT [ "/app/run_starlette.sh" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"id": "falling-salad-5976", | ||
"type": "docker" | ||
} |