Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ianwinsemius
Copy link

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
Owner

So cool! I will check this out tomorrow.

@JPHutchins
Copy link
Owner

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

Comment on lines +7 to +8
- RABBITMQ_DEFAULT_USER=jp
- RABBITMQ_DEFAULT_PASS=admin
Copy link
Owner

@JPHutchins JPHutchins Mar 5, 2022

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

@@ -23,4 +23,4 @@ export CERT_PATH=test/cert/cert.crt
export KEY_PATH=test/cert/private.key
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
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
Copy link
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
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
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants