Dockerfile should build `rules-engine`
#116 opened on 2023年12月1日
Repository metrics
- Stars
- (23 stars)
- PR merge metrics
- (PR metrics pending)
説明
Right now the web app deployment only deploys an obsolete no-dependency python rules-engine file. With the newest version of the Rules Engine in the repository, it is using a python package wheel (whl) file which needs to be built on every deployment.
The whl file is already getting built for use in the unit tests. The test is committed and passing.
But we can't use the Rules Engine whl file yet in the browser, and we'd like to. You can help.
We don't want to check in the whl file, but to build it "just-in-time" at the key places. There is a reference example to help you start. It runs whenever we do npm run test app/utils/pyodide.test.ts
Dockerfile build of the Python whl
- Practice with local deployment of Docker first but after you get comfortable, instead of
mv Dockerfile ./heat-stackas it instructs, try moving it to the root of the project. - Modify the
heat-stackDockerfile in a way so the../rules-enginefolder can do a build.- You need to figure out how to get the
rules-enginefolder into the built docker image.
- You need to figure out how to get the
- In the Dockerfile, add a line to run the equivalent of these build commands that are running before
vitestin the otherpackage.jsonexample: https://github.com/codeforboston/home-energy-analysis-tool/blob/0b6f2d11b264a1db9d84ba5c1c52da5c07e93c0e/heat-stack/package.json#L23 - Copy the generated file from
rules-engine/dist/rules_engine-*-py3-none-any.whl- to
heat-stack/public/pyodide-env
- to
Optional: Package.json enable npm run dev to build & copy the whl
- As a bonus task, modify the
package.jsondevline to build thewhljust in time and place it in the same folder. - add the built file to .gitignore
Fix Github Actions to match
- Fork the repository into your GitHub account so you can do tests of Github Actions silently.
- One challenge is understanding all the places where
working-directoryare being modified in the early and deployment parts of the heat-stack Github Action file .
- One challenge is understanding all the places where
- Ask for the flyio staging deploy key for your GHA tests. Put the key in secrets as the documentation describes in step 5.
- Instead of moving the
Dockerfileand.dockerignoreto.which is currently./heat-stackmove it to the project root at https://github.com/codeforboston/home-energy-analysis-tool/blob/7fc77abacbe83f06da2d167e10d4caf7c2a1e9aa/.github/workflows/heat-stack.yml#L182-L183