Skip to content
This repository was archived by the owner on Dec 31, 2024. It is now read-only.

[WIP] Still erroring out, but I am a bit stuck#43

Draft
ianwinsemius wants to merge 1 commit into
JPHutchins:masterfrom
ianwinsemius:master
Draft

[WIP] Still erroring out, but I am a bit stuck#43
ianwinsemius wants to merge 1 commit into
JPHutchins:masterfrom
ianwinsemius:master

Conversation

@ianwinsemius

Copy link
Copy Markdown

If you'd like to run this and see if you recognize the errors, I think I'm getting close, but also think that the fact that celery workers are going to run in the background will cause them to be ignored, and for the container to exit.

@JPHutchins

Copy link
Copy Markdown
Owner

So cool! I will check this out tomorrow.

@JPHutchins

Copy link
Copy Markdown
Owner

This is awesome, it builds my 30+ minute instructions in a few minutes! Commenting the diff with some fixes and workarounds

Comment thread docker-compose.yml
Comment on lines +7 to +8
- RABBITMQ_DEFAULT_USER=jp
- RABBITMQ_DEFAULT_PASS=admin

@JPHutchins JPHutchins Mar 5, 2022

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Elsewhere it looks for these without "DEFAULT" - so changing to:

    environment:
      - RABBITMQ_USER=jp
      - RABBITMQ_PASS=admin

seemed to resolve some of the errors

Comment thread run-wsgi-dev
export API_RESPONSE_KEY=xS5MqJ6N9CyH-hvqAGrmBVAxFMOyauMpdrdqCZa1eqo=
export IP_AND_PORT=$(hostname -I | awk '{print $1}'):5000
./venv/bin/uwsgi --http 0.0.0.0:5000 --gevent 100 --wsgi-file wsgi.py --callable app
./venv/bin/uwsgi --http 0.0.0.0:5001 --gevent 100 --wsgi-file wsgi.py --callable app

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like in the docker environment a python venv is not needed. So changing this line to uwsgi --http 0.0.0.0:5001 --gevent 100 --wsgi-file wsgi.py --callable app seems to have it find uwsgi. pip installs it someplace in path luckily!

Comment on lines +5 to +7
./run-wsgi-dev
./run-io-worker
./run-cpu-worker No newline at end of file

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the actual server these are run each as a separate sytemd process. Thus the instructions to run them each in a separate terminal.

This is all a bit misleading - the core of the app will work with just running the uwsgi server. The io and cpu workers process incoming data from PGE's servers - a work around to use multiple cores with python.

I'll also need to look for the flask entry point.

TLDR most devs would rather run the flask development server and not worry about the celery workers. I added these scripts so that I could simulate the live server - in fact, it basically IS the production setup, just run from terminals instead of systemd.

@JPHutchins

Copy link
Copy Markdown
Owner

With this the uwsgi server runs and I am able to go to Docker Desktop and click view in browser. I tried with ports 5000 and 5001, I think either is OK.

Unless docker is way more magic than I understand, I would think that the run-io-work and run-cpu-worker need there own service since the run-wsgi-dev script should never exit.

I was feeling spicy so I changed the init.sh to:

./run-wsgi-dev &
./run-io-worker &
./run-cpu-worker

Which ends up revealing some weird celery errors.

@JPHutchins

Copy link
Copy Markdown
Owner

The script test-gui should run the flask development server.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants