- Personal project to experiment with stuff
- Look like you know what you are talking about
- Who am I kidding? Is anyone even reading item number 3 in in a "purpose" list?
- run on python 3.10.4 and up
pyenv shell 3.10.4
poetry env use python3.10
poetry install
poetry shell
- run help file to understand/debug app
python src/visualizer/help.py
- run local server for development
uvicorn src.main:app --reload
- then visit http://127.0.0.1:8000 for normal api
- and http://127.0.0.1:8000/docs for OpenAPI docs
make build DOCKER_TAG=v1.0
: This will build the docker image, provided you can run make files and have docker installedmake run DOCKER_TAG=v1.0
: This will run the built image in detached mode- At this stage, you have the following options:
- Visit http://0.0.0.0:8000/docs to visit and interact with the API
- Look up the logs of the applicaton using
docker logs -tf sudoku_solver_fastapi
- Get inside the container
docker exec -it sudoku_solver_fastapi bash
make clean
: To stop and remove the containermake clean-image DOCKER_TAG=v1.0
: To remove the docker image
- login to docker-cli:
docker login -u <YOUR_DOCKERHUB_USERNAME>
- notes:
- your local gpg key may/maynot be valid right now
- have the passphrase key handy
make docker-push DOCKER_TAG=v1.0
I was watching a video on sudoku solver with python on Youtube when I realised that this is probably a simple problem. This Computerphile video talks about backtracking algorithms which I did not follow at the time.
Cut to two weeks later, I am still thinking of the video. I find myself attempting to actually do Sudoku problems. Since this is an interesting problem and I often need help to solve the difficult problems, I started thinking of writing a script to solve it.
The challenge is to NOT watch the video again or research any type of backtracking algorithm.
Better tagging of docker images i.e. no hard-codingPush to a docker repository. Use that pipeline instead of doingdocker save
here anddocker load
at the infra-as-code codebaseuse sudoku solver package to separate sudoku solver/creator logic from server/microservice/web-api logicuse package created locallyuse package downloaded from pypi
Deprecate makefile calls to save+zip docker image- create a service that saves incomplete sudoku grids (i.e. problems) into a postgres/sqlite DB using sqlalchemy
- create background tasks that check and generate sudoku problems and save to aforementioned DB
- make a new endpoint that serves problems from the DB and starts background tasks to cleanup/create new rows in DB
- use redis/celery to manage tasks?
- use docker-compose instead of docker run to build images and save to dockerhub
- Make pygame flip between initial problem and presented solution periodically
- Make each iteration of recursion visual, make it pretty