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

SPS release may not be complete #86

Open
davidtheplatform opened this issue Jul 21, 2024 · 15 comments
Open

SPS release may not be complete #86

davidtheplatform opened this issue Jul 21, 2024 · 15 comments
Assignees
Labels
bug Something isn't working snazzle production server An issue related to Snazzle Production Server

Comments

@davidtheplatform
Copy link
Contributor

I'm trying to install snazzle through the SPS release, and I think some steps are missing.

  • The environment in .venv is broken. source .venv/bin/activate doesn't seem to do anything and the other files in .venv/bin/ complain about missing some files.
  • app.py doesn't seem to activate the venv and doesn't install the correct dependencies
  • start.sh references files in /etc/snazzle/, which as far as I can tell aren't created anywhere.

There may be more, these are just the ones I can find right now

@redstone-dev
Copy link
Collaborator

redstone-dev commented Jul 22, 2024

I knew something like this would happen... 🤦

A true It Works On My Machine™️ moment.

  1. The venv being broken doesn't surprise me all that much, I've had weird problems with virtual environments in the past. I'm not too sure what to do about it though.

  2. The automatic dependency installer should do that for you, so that's strange. Check the logs directory where you installed SPS.

  3. Are you sure you're following the instructions listed under the release for SPS v2? It talks about how to set it up completely.

Once I know what's happening, I'll fix these for SPS v3 👍🏻

@davidtheplatform
Copy link
Contributor Author

Which directory should SNAZZLE_PATH point to? Right now I have it set to the directory with app.py

@davidtheplatform
Copy link
Contributor Author

Also is the systemd section required?

@redstone-dev
Copy link
Collaborator

redstone-dev commented Jul 22, 2024

Which directory should SNAZZLE_PATH point to? Right now I have it set to the directory with app.py

That's what it should be set to. Ex. if that file's path is /home/user/Snazzle/app.py, SNAZZLE_PATH should be /home/user/Snazzle. You should NOT use ./, ../ or ~ in the path because it should be an absolute path and not depend on the current user.

Also is the systemd section required?

No, but it should make running Snazzle 24/7 a bit easier. Though it might be a bit annoying to use the resource monitor page because I don't know how you can get stdin in a systemd service :P

I just realized that /etc/snazzle should probably only be accessed if SPS is running as a daemon/systemd service, so that will also be in v3.

@redstone-dev redstone-dev added bug Something isn't working snazzle production server An issue related to Snazzle Production Server labels Jul 22, 2024
@redstone-dev redstone-dev self-assigned this Jul 22, 2024
@davidtheplatform
Copy link
Contributor Author

davidtheplatform commented Jul 22, 2024

I’m going to start over and record my steps:

  1. wget https://github.com/SnarpleDev/Snazzle/releases/download/server-v2/Snazzle-Prod-Server-v2.tar.gz
  2. tar -xf snazzle.whatever
  3. cd snazzle-server/Snazzle
  4. sudo apt install libev-dev
  5. In .env change the username to the correct one (I extracted the tar to /home/myusername)
  6. python3 app.py
  7. No module named dotenv

@redstone-dev
Copy link
Collaborator

redstone-dev commented Jul 22, 2024

  1. No module named dotenv

You didn't source .venv/bin/activate, do that and then run python3 app.py.

@davidtheplatform
Copy link
Contributor Author

  1. No module named dotenv

You didn't source .venv/bin/activate, do that and then run python3 app.py.

That doesn’t change anything, also it’s not in the instructions

@davidtheplatform
Copy link
Contributor Author

The problem is that virtual envs shouldn’t be copied because they use absolute paths that are made when the venv is created.

The intended way of distributing something like this is to package the source code without packages, and include a requirements.txt that the end user installs themselves. You can make the requirements.txt with ‘pip freeze’

@redstone-dev
Copy link
Collaborator

The problem is that virtual envs shouldn’t be copied because they use absolute paths that are made when the venv is created.

The intended way of distributing something like this is to package the source code without packages, and include a requirements.txt that the end user installs themselves. You can make the requirements.txt with ‘pip freeze’

Oh right, I forgot about that. I'll fix it in the morning

@dynamixbot
Copy link
Member

The problem is that virtual envs shouldn’t be copied because they use absolute paths that are made when the venv is created.
The intended way of distributing something like this is to package the source code without packages, and include a requirements.txt that the end user installs themselves. You can make the requirements.txt with ‘pip freeze’

Oh right, I forgot about that. I'll fix it in the morning

♪ Gotta add some documentation ♪

@redstone-dev
Copy link
Collaborator

I said I'd fix it in the morning but it took me 5 days to fix it LMAO

Not sure it's 100% fixed though. Please verify v3 and tell me if there are still problems

@davidtheplatform
Copy link
Contributor Author

davidtheplatform commented Jul 27, 2024

The dotenv path in install_reqs.py is hardcoded to /etc/snazzle/.env when it should probably be ./.env by default
Edit: same thing in dazzle.py

@davidtheplatform
Copy link
Contributor Author

davidtheplatform commented Jul 27, 2024

Got it working: https://snazzle.davidtheplatform.eu.org/

@redstone-dev
Copy link
Collaborator

The dotenv path in install_reqs.py is hardcoded to /etc/snazzle/.env when it should probably be ./.env by default Edit: same thing in dazzle.py

Will fix in v4

@redstone-dev
Copy link
Collaborator

The dotenv path in install_reqs.py is hardcoded to /etc/snazzle/.env when it should probably be ./.env by default Edit: same thing in dazzle.py

Will fix in v4

v4 never came 😔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working snazzle production server An issue related to Snazzle Production Server
Projects
None yet
Development

No branches or pull requests

3 participants