Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
davorrunje committed Nov 12, 2024
1 parent b83d88b commit 5277755
Show file tree
Hide file tree
Showing 22 changed files with 51 additions and 17 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/test-playwright.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,14 @@ jobs:
id: fastagency-start
run: |
# Start fastagency and grab its pid
export COVERAGE_PROCESS_START
nohup fastagency run e2e/llm-sans/main.py >nohup.txt 2>nohup-error.txt &
# Get the process ID (PID)
FAST_PID=$!
echo "Started fastagency with PID: $FAST_PID"
echo "FAST_PID=$FAST_PID" >> $GITHUB_OUTPUT
echo "Sleeping for 15 seconds to let fastagency start up..."
sleep 15
echo "Sleeping for 5 seconds to let fastagency start up..."
sleep 5
env:
COVERAGE_PROCESS_START: "e2e/playwright.coverage.cfg"
- run: echo "obtained FAST_PID" ${{ steps.fastagency-start.outputs.FAST_PID}}
Expand Down
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,18 @@ RUN pip install --upgrade pip && pip install --no-cache-dir -e "."
RUN adduser --disabled-password --gecos '' appuser \
&& chown -R appuser /app \
&& chown -R appuser:appuser /etc/nginx/conf.d /var/log/nginx /var/lib/nginx \
&& touch /run/nginx.pid && chown -R appuser:appuser /run/nginx.pid
&& touch /run/nginx.pid && chown -R appuser:appuser /run/nginx.pid \
# Allow binding to ports > 1024 without root
&& sed -i 's/listen 80/listen 9999/g' /etc/nginx/sites-available/default \
&& sed -i 's/listen \[::\]:80/listen \[::\]:9999/g' /etc/nginx/sites-available/default \
# Create required directories with correct permissions
&& mkdir -p /var/cache/nginx /var/run \
&& chown -R appuser:appuser /var/cache/nginx /var/run

USER appuser

EXPOSE 8000 8008 8888
# ToDo: Fix exposing ports
# EXPOSE 8000 8008 8888

CMD ["/app/run_fastagency.sh"]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ server {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_redirect off;
proxy_buffering off;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ do
sed -i "5i\ server 127.0.0.1:$PORT;" nginx.conf.template
done
envsubst '${MESOP_PORT}' < nginx.conf.template >/etc/nginx/conf.d/default.conf
echo "Nginx config:"
cat /etc/nginx/conf.d/default.conf

# Start nginx
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ name = "my_fastagency_app"

dependencies = [
"fastagency[autogen,mesop,server,fastapi]>=0.3.0",

]

[project.optional-dependencies]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/bin/bash

docker build -t deploy_fastagency -f docker/Dockerfile --progress plain .
echo -e "\033[0;32mBuilding fastagency docker image\033[0m"
docker build -t deploy_fastagency -f docker/Dockerfile --progress plain . && \
echo -e "\033[0;32mSuccessfully built fastagency docker image\033[0m"
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
#!/bin/bash

echo -e "\033[0;32mLogging into fly.io\033[0m"
fly auth login

echo -e "\033[0;32mDeploying to fly.io\033[0m"
fly launch --config fly.toml --copy-config --yes

echo -e "\033[0;32mSetting secrets\033[0m"
fly secrets set OPENAI_API_KEY=$OPENAI_API_KEY
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,18 @@ RUN pip install --upgrade pip && pip install --no-cache-dir -e "."
RUN adduser --disabled-password --gecos '' appuser \
&& chown -R appuser /app \
&& chown -R appuser:appuser /etc/nginx/conf.d /var/log/nginx /var/lib/nginx \
&& touch /run/nginx.pid && chown -R appuser:appuser /run/nginx.pid
&& touch /run/nginx.pid && chown -R appuser:appuser /run/nginx.pid \
# Allow binding to ports > 1024 without root
&& sed -i 's/listen 80/listen 9999/g' /etc/nginx/sites-available/default \
&& sed -i 's/listen \[::\]:80/listen \[::\]:9999/g' /etc/nginx/sites-available/default \
# Create required directories with correct permissions
&& mkdir -p /var/cache/nginx /var/run \
&& chown -R appuser:appuser /var/cache/nginx /var/run

USER appuser

EXPOSE 8000 8008 8888
# ToDo: Fix exposing ports
# EXPOSE 8000 8008 8888

CMD ["/app/run_fastagency.sh"]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ server {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_redirect off;
proxy_buffering off;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ do
sed -i "5i\ server 127.0.0.1:$PORT;" nginx.conf.template
done
envsubst '${MESOP_PORT}' < nginx.conf.template >/etc/nginx/conf.d/default.conf
echo "Nginx config:"
cat /etc/nginx/conf.d/default.conf

# Start nginx
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ name = "my_fastagency_app"

dependencies = [
"fastagency[autogen,mesop,server]>=0.3.0",

]

[project.optional-dependencies]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/bin/bash

docker build -t deploy_fastagency -f docker/Dockerfile --progress plain .
echo -e "\033[0;32mBuilding fastagency docker image\033[0m"
docker build -t deploy_fastagency -f docker/Dockerfile --progress plain . && \
echo -e "\033[0;32mSuccessfully built fastagency docker image\033[0m"
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
#!/bin/bash

echo -e "\033[0;32mLogging into fly.io\033[0m"
fly auth login

echo -e "\033[0;32mDeploying to fly.io\033[0m"
fly launch --config fly.toml --copy-config --yes

echo -e "\033[0;32mSetting secrets\033[0m"
fly secrets set OPENAI_API_KEY=$OPENAI_API_KEY
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,18 @@ RUN pip install --upgrade pip && pip install --no-cache-dir -e "."
RUN adduser --disabled-password --gecos '' appuser \
&& chown -R appuser /app \
&& chown -R appuser:appuser /etc/nginx/conf.d /var/log/nginx /var/lib/nginx \
&& touch /run/nginx.pid && chown -R appuser:appuser /run/nginx.pid
&& touch /run/nginx.pid && chown -R appuser:appuser /run/nginx.pid \
# Allow binding to ports > 1024 without root
&& sed -i 's/listen 80/listen 9999/g' /etc/nginx/sites-available/default \
&& sed -i 's/listen \[::\]:80/listen \[::\]:9999/g' /etc/nginx/sites-available/default \
# Create required directories with correct permissions
&& mkdir -p /var/cache/nginx /var/run \
&& chown -R appuser:appuser /var/cache/nginx /var/run

USER appuser

EXPOSE 8000 8008 8888
# ToDo: Fix exposing ports
# EXPOSE 8000 8008 8888

CMD ["/app/run_fastagency.sh"]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ server {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_redirect off;
proxy_buffering off;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ do
sed -i "5i\ server 127.0.0.1:$PORT;" nginx.conf.template
done
envsubst '${MESOP_PORT}' < nginx.conf.template >/etc/nginx/conf.d/default.conf
echo "Nginx config:"
cat /etc/nginx/conf.d/default.conf

# Start nginx
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ name = "my_fastagency_app"

dependencies = [
"fastagency[autogen,mesop,server,fastapi,nats]>=0.3.0",

]

[project.optional-dependencies]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/bin/bash

docker build -t deploy_fastagency -f docker/Dockerfile --progress plain .
echo -e "\033[0;32mBuilding fastagency docker image\033[0m"
docker build -t deploy_fastagency -f docker/Dockerfile --progress plain . && \
echo -e "\033[0;32mSuccessfully built fastagency docker image\033[0m"
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
#!/bin/bash

echo -e "\033[0;32mLogging into fly.io\033[0m"
fly auth login

echo -e "\033[0;32mDeploying to fly.io\033[0m"
fly launch --config fly.toml --copy-config --yes

echo -e "\033[0;32mSetting secrets\033[0m"
fly secrets set OPENAI_API_KEY=$OPENAI_API_KEY

0 comments on commit 5277755

Please sign in to comment.