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

Please add tests, also check out my fork which greatly improves this repo and has a python/js test suite #16

Open
zackees opened this issue Jul 4, 2024 · 4 comments

Comments

@zackees
Copy link

zackees commented Jul 4, 2024

This is my fork of your repo.

https://github.com/zackees/SmoothMQ

While your repo kinda works but is not really tested and doesn't work on Render/DigitalOcean, mine does. Additionally, I have added nginx and added auth so that the codebase can be put on the public web. I've also implemented persistent storage of the sqlite data at /var/data so a disk/volume can be attached so that the queue can survive reboots/redeploys

Here is a change list:

  • port 3000 -> localhost:80/ui and is protected with basic http authorization.
    • user: user
    • password: <AMAZON_SECRET_KEY>
  • port 3001 -> localhost:80/ and is protected with the amazon secret key
  • Can be dropped into Render.com / Digital Ocean
    • If you allocate a disk at /var/data then the SQS queue will be persistant across reboots/deploys
  • This code base has a test suite
    • javascript
    • python
  • Deleting of Queues is implemented

Also note that I created a minimal AWS sqs wrapper so that legacy js clients can use this package:

// const AWS = require('aws-sdk');  // this is replaced by sqs-legacy-adapter
const AWS = require('sqs-legacy-adapter');
@zackees zackees changed the title Please add tests and check out my fork which greatly improves this repo and has a python/js test suite that is function Please add tests, also check out my fork which greatly improves this repo and has a python/js test suite Jul 4, 2024
@poundifdef
Copy link
Owner

Thanks for spending so much time looking through the code. Are you okay with me picking and choosing bits to copy in?

For example, I wouldn’t use nginx for basic auth, instead keeping that code in go, but deletes are looking good and I’d love to add that.

@zackees
Copy link
Author

zackees commented Jul 4, 2024

Yeah absolutely. I made this fork public to give back to you. Notice that I massively speed up the docker rebuild by putting the incremental building of the go project as different cache layers.

testing

The install stuff at the root of the project is to install the python dependencies for testing. I originally tried to put this stuff in the test/py directory, but VSCode refuses to invoke the debugger unless it's at the root, for some reason.

By the way, the speed of these improvements was made possible because of my advanced ai coding assistant. You should check it out:

pip install advanced-aicode

@poundifdef
Copy link
Owner

poundifdef commented Jul 21, 2024

Thought you'd be interested in some updates that are now in the main branch:

  • Everything (ports, credentials, etc) is configurable via env vars and cmdline flags
  • Configure database location
  • Option to have all web services (dashboard, ui) served on a single port, no need for nginx
  • Dashboard supports basic auth
  • Built in "tester" to test sending and receiving messages

Here's a working render.yaml:

services:
  - type: web
    runtime: docker
    name: smoothmq
    repo: https://github.com/poundifdef/smoothmq.git
    healthCheckPath: /
    envVars:
      - key: PORT
        value: 8080
      - key: Q_SERVER_USE_SINGLE_PORT
        value: true
      - key: Q_SQLITE_PATH
        value: '/data/smoothmq.sqlite'
    disk:
      name: smoothmq-data
      mountPath: /data
      sizeGB: 1

@zackees
Copy link
Author

zackees commented Jul 23, 2024

This is amazing!

Did you see my code samples for testing the api? This is something you might want to include since a lot of people are using javascript and your solution was only tested in python.

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

No branches or pull requests

2 participants