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

Docker rules engine 116 #201

Open
wants to merge 23 commits into
base: main
Choose a base branch
from
Open

Conversation

ethanstrominger
Copy link
Collaborator

@ethanstrominger ethanstrominger commented Jun 14, 2024

see #116

prior work #194

thadk and others added 13 commits May 14, 2024 23:39
Co-authored-by: Camden Blatchly <camdenblatchly@users.noreply.github.com>
Co-authored-by: plocket <plocket@users.noreply.github.com>
Co-authored-by: Camden Blatchly <camdenblatchly@users.noreply.github.com>
Co-authored-by: plocket <plocket@users.noreply.github.com>
Co-authored-by: Leopardfoot <Leopardfoot@users.noreply.github.com>
@@ -144,6 +145,9 @@ jobs:
- name: 🖼 Build icons
working-directory: ${{ env.heat-stack-working-directory }}
run: npm run build:icons
- name: prisma generate
working-directory: ${{ env.heat-stack-working-directory }}
run: npx prisma generate
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may need to come back to this.

@thadk
Copy link
Member

thadk commented Nov 6, 2024

I had to use amd64 instead of arm64 due to a bug like this "@rollup/rollup-linux-arm64-gnu. npm has a bug related to optional dependencies" on npm run build no matter what I did. But otherwise it worked great! We made a fresh branch 116_after_python_folder and will add you as a co-author, Ethan. Thanks so much!

docker run --platform linux/amd64 -p 8081:8081 -it 396e0a0a4e93 bash
SESSION_SECRET="asd" HONEYPOT_SECRET="asdfasdfasdf" npm run start
image

@thadk
Copy link
Member

thadk commented Nov 6, 2024

TODO: create readme and update as we go so people can run it locally, fly.io context, and/or on github actions.

thadk added a commit that referenced this pull request Nov 6, 2024
Co-authored-by: thatoldplatitude <thatoldplatitude@users.noreply.github.com>
Co-authored-by: Ethan-Strominger <32078396+ethanstrominger@users.noreply.github.com>
@thadk
Copy link
Member

thadk commented Nov 6, 2024

TODO fix fly deploy --local-only

home-energy-analysis-tool/heat-stack on  116_after_python_folder [⇡] via ⬢ v20.11.0 
➜ fly deploy --local-only                       
==> Verifying app config
Validating /Users/thadk/gitrepos/home-energy-analysis-tool/heat-stack/fly.toml
✓ Configuration is valid
--> Verified app config
==> Building image
==> Building image with Docker
--> docker host: 24.0.6 linux aarch64
[+] Building 0.9s (37/37) FINISHED                                                                                                                                                              
 => [internal] load .dockerignore                                                                                                                                                          0.0s
 => => transferring context: 2B                                                                                                                                                            0.0s
 => [internal] load build definition from Dockerfile                                                                                                                                       0.0s
 => => transferring dockerfile: 3.47kB                                                                                                                                                     0.0s
 => [internal] load metadata for docker.io/flyio/litefs:0.5.11                                                                                                                             0.5s
 => [internal] load metadata for docker.io/library/node:20-bookworm-slim                                                                                                                   0.5s
 => [internal] load metadata for docker.io/library/python:3.12.3-slim-bookworm                                                                                                             0.8s
 => [internal] load build context                                                                                                                                                          0.0s
 => => transferring context: 2B                                                                                                                                                            0.0s
 => FROM docker.io/flyio/litefs:0.5.11@sha256:d899d275c61ba876f54f6b76ceeadb586e829f6728465cb8ee2434d34ac5054a                                                                             0.0s
 => [rules-build 1/4] FROM docker.io/library/python:3.12.3-slim-bookworm@sha256:afc139a0a640942491ec481ad8dda10f2c5b753f5c969393b12480155fe15a63                                           0.0s
 => [base 1/2] FROM docker.io/library/node:20-bookworm-slim@sha256:ec35a66c9a0a275b027debde05247c081f8b2f0c43d7399d3a6ad5660cee2f6a                                                        0.0s
 => CACHED [base 2/2] RUN apt-get update && apt-get install -y fuse3 openssl sqlite3 ca-certificates                                                                                       0.0s
 => CACHED [stage-5  1/16] RUN echo "#!/bin/sh\nset -x\nsqlite3 $DATABASE_URL" > /usr/local/bin/database-cli && chmod +x /usr/local/bin/database-cli                                       0.0s
 => CACHED [stage-5  2/16] WORKDIR /myapp/heat-stack                                                                                                                                       0.0s
 => CACHED [stage-5  3/16] RUN INTERNAL_COMMAND_TOKEN=$(openssl rand -hex 32) &&   echo "INTERNAL_COMMAND_TOKEN=$INTERNAL_COMMAND_TOKEN" > .env                                            0.0s
 => CACHED [production-deps 1/4] WORKDIR /myapp/heat-stack                                                                                                                                 0.0s
 => ERROR [deps 2/3] ADD heat-stack/package.json heat-stack/package-lock.json heat-stack/.npmrc ./                                                                                         0.0s
 => CACHED [deps 3/3] RUN npm install --include=dev                                                                                                                                        0.0s
 => CACHED [production-deps 2/4] COPY --from=deps /myapp/heat-stack/node_modules /myapp/heat-stack/node_modules                                                                            0.0s
 => ERROR [production-deps 3/4] ADD heat-stack/package.json heat-stack/package-lock.json heat-stack/.npmrc ./                                                                              0.0s
 => CACHED [production-deps 4/4] RUN npm prune --omit=dev                                                                                                                                  0.0s
 => CACHED [stage-5  4/16] COPY --from=production-deps /myapp/heat-stack/node_modules /myapp/heat-stack/node_modules                                                                       0.0s
 => ERROR [heat-build 3/4] ADD heat-stack/. .                                                                                                                                              0.0s
 => CACHED [heat-build 4/4] RUN npm run build                                                                                                                                              0.0s
 => CACHED [stage-5  5/16] COPY --from=heat-build /myapp/heat-stack/node_modules/.prisma /myapp/heat-stack/node_modules/.prisma                                                            0.0s
 => CACHED [stage-5  6/16] COPY --from=heat-build /myapp/heat-stack/server-build /myapp/heat-stack/server-build                                                                            0.0s
 => CACHED [stage-5  7/16] COPY --from=heat-build /myapp/heat-stack/build /myapp/heat-stack/build                                                                                          0.0s
 => CACHED [stage-5  8/16] COPY --from=heat-build /myapp/heat-stack/public /myapp/heat-stack/public                                                                                        0.0s
 => CACHED [stage-5  9/16] COPY --from=heat-build /myapp/heat-stack/package.json /myapp/heat-stack/package.json                                                                            0.0s
 => CACHED [stage-5 10/16] COPY --from=heat-build /myapp/heat-stack/prisma /myapp/heat-stack/prisma                                                                                        0.0s
 => CACHED [stage-5 11/16] COPY --from=heat-build /myapp/heat-stack/app/components/ui/icons /myapp/heat-stack/app/components/ui/icons                                                      0.0s
 => CACHED [rules-build 2/4] WORKDIR /myapp                                                                                                                                                0.0s
 => ERROR [rules-build 3/4] ADD python/. .                                                                                                                                                 0.0s
 => CACHED [rules-build 4/4] RUN bash -c "source setup-wheel.sh"                                                                                                                           0.0s
 => CACHED [stage-5 12/16] COPY --from=rules-build /myapp/dist/*.whl /myapp/heat-stack/public/pyodide-env/                                                                                 0.0s
 => CACHED [stage-5 13/16] COPY --from=flyio/litefs:0.5.11 /usr/local/bin/litefs /usr/local/bin/litefs                                                                                     0.0s
 => ERROR [stage-5 14/16] ADD heat-stack/other/litefs.yml /etc/litefs.yml                                                                                                                  0.0s
 => CACHED [stage-5 15/16] RUN mkdir -p /data /litefs/data                                                                                                                                 0.0s
 => ERROR [stage-5 16/16] ADD heat-stack/. .                                                                                                                                               0.0s
------
 > [deps 2/3] ADD heat-stack/package.json heat-stack/package-lock.json heat-stack/.npmrc ./:
------
------
 > [production-deps 3/4] ADD heat-stack/package.json heat-stack/package-lock.json heat-stack/.npmrc ./:
------
------
 > [heat-build 3/4] ADD heat-stack/. .:
------
------
 > [rules-build 3/4] ADD python/. .:
------
------
 > [stage-5 14/16] ADD heat-stack/other/litefs.yml /etc/litefs.yml:
------
------
 > [stage-5 16/16] ADD heat-stack/. .:
------
==> Building image
==> Building image with Docker
--> docker host: 24.0.6 linux aarch64
[+] Building 0.1s (37/37) FINISHED                                                                                                                                                              
 => [internal] load build definition from Dockerfile                                                                                                                                       0.0s
 => => transferring dockerfile: 3.47kB                                                                                                                                                     0.0s
 => [internal] load .dockerignore                                                                                                                                                          0.0s
 => => transferring context: 2B                                                                                                                                                            0.0s
 => [internal] load metadata for docker.io/flyio/litefs:0.5.11                                                                                                                             0.1s
 => [internal] load metadata for docker.io/library/node:20-bookworm-slim                                                                                                                   0.1s
 => [internal] load metadata for docker.io/library/python:3.12.3-slim-bookworm                                                                                                             0.1s
 => [internal] load build context                                                                                                                                                          0.0s
 => => transferring context: 2B                                                                                                                                                            0.0s
 => [base 1/2] FROM docker.io/library/node:20-bookworm-slim@sha256:ec35a66c9a0a275b027debde05247c081f8b2f0c43d7399d3a6ad5660cee2f6a                                                        0.0s
 => [rules-build 1/4] FROM docker.io/library/python:3.12.3-slim-bookworm@sha256:afc139a0a640942491ec481ad8dda10f2c5b753f5c969393b12480155fe15a63                                           0.0s
 => FROM docker.io/flyio/litefs:0.5.11@sha256:d899d275c61ba876f54f6b76ceeadb586e829f6728465cb8ee2434d34ac5054a                                                                             0.0s
 => CACHED [base 2/2] RUN apt-get update && apt-get install -y fuse3 openssl sqlite3 ca-certificates                                                                                       0.0s
 => CACHED [production-deps 1/4] WORKDIR /myapp/heat-stack                                                                                                                                 0.0s
 => ERROR [deps 2/3] ADD heat-stack/package.json heat-stack/package-lock.json heat-stack/.npmrc ./                                                                                         0.0s
 => CACHED [deps 3/3] RUN npm install --include=dev                                                                                                                                        0.0s
 => CACHED [production-deps 2/4] COPY --from=deps /myapp/heat-stack/node_modules /myapp/heat-stack/node_modules                                                                            0.0s
 => ERROR [heat-build 3/4] ADD heat-stack/. .                                                                                                                                              0.0s
 => CACHED [stage-5  1/16] RUN echo "#!/bin/sh\nset -x\nsqlite3 $DATABASE_URL" > /usr/local/bin/database-cli && chmod +x /usr/local/bin/database-cli                                       0.0s
 => CACHED [stage-5  2/16] WORKDIR /myapp/heat-stack                                                                                                                                       0.0s
 => CACHED [stage-5  3/16] RUN INTERNAL_COMMAND_TOKEN=$(openssl rand -hex 32) &&   echo "INTERNAL_COMMAND_TOKEN=$INTERNAL_COMMAND_TOKEN" > .env                                            0.0s
 => ERROR [production-deps 3/4] ADD heat-stack/package.json heat-stack/package-lock.json heat-stack/.npmrc ./                                                                              0.0s
 => CACHED [production-deps 4/4] RUN npm prune --omit=dev                                                                                                                                  0.0s
 => CACHED [stage-5  4/16] COPY --from=production-deps /myapp/heat-stack/node_modules /myapp/heat-stack/node_modules                                                                       0.0s
 => CACHED [heat-build 4/4] RUN npm run build                                                                                                                                              0.0s
 => CACHED [stage-5  5/16] COPY --from=heat-build /myapp/heat-stack/node_modules/.prisma /myapp/heat-stack/node_modules/.prisma                                                            0.0s
 => CACHED [stage-5  6/16] COPY --from=heat-build /myapp/heat-stack/server-build /myapp/heat-stack/server-build                                                                            0.0s
 => CACHED [stage-5  7/16] COPY --from=heat-build /myapp/heat-stack/build /myapp/heat-stack/build                                                                                          0.0s
 => CACHED [stage-5  8/16] COPY --from=heat-build /myapp/heat-stack/public /myapp/heat-stack/public                                                                                        0.0s
 => CACHED [stage-5  9/16] COPY --from=heat-build /myapp/heat-stack/package.json /myapp/heat-stack/package.json                                                                            0.0s
 => CACHED [stage-5 10/16] COPY --from=heat-build /myapp/heat-stack/prisma /myapp/heat-stack/prisma                                                                                        0.0s
 => CACHED [stage-5 11/16] COPY --from=heat-build /myapp/heat-stack/app/components/ui/icons /myapp/heat-stack/app/components/ui/icons                                                      0.0s
 => CACHED [rules-build 2/4] WORKDIR /myapp                                                                                                                                                0.0s
 => ERROR [rules-build 3/4] ADD python/. .                                                                                                                                                 0.0s
 => CACHED [rules-build 4/4] RUN bash -c "source setup-wheel.sh"                                                                                                                           0.0s
 => CACHED [stage-5 12/16] COPY --from=rules-build /myapp/dist/*.whl /myapp/heat-stack/public/pyodide-env/                                                                                 0.0s
 => CACHED [stage-5 13/16] COPY --from=flyio/litefs:0.5.11 /usr/local/bin/litefs /usr/local/bin/litefs                                                                                     0.0s
 => ERROR [stage-5 14/16] ADD heat-stack/other/litefs.yml /etc/litefs.yml                                                                                                                  0.0s
 => CACHED [stage-5 15/16] RUN mkdir -p /data /litefs/data                                                                                                                                 0.0s
 => ERROR [stage-5 16/16] ADD heat-stack/. .                                                                                                                                               0.0s
------
 > [deps 2/3] ADD heat-stack/package.json heat-stack/package-lock.json heat-stack/.npmrc ./:
------
------
 > [heat-build 3/4] ADD heat-stack/. .:
------
------
 > [production-deps 3/4] ADD heat-stack/package.json heat-stack/package-lock.json heat-stack/.npmrc ./:
------
------
 > [rules-build 3/4] ADD python/. .:
------
------
 > [stage-5 14/16] ADD heat-stack/other/litefs.yml /etc/litefs.yml:
------
------
 > [stage-5 16/16] ADD heat-stack/. .:
------
Error: failed to fetch an image or build from source: error building: failed to solve: failed to compute cache key: failed to calculate checksum of ref 74185b9f-de0b-47fc-b53a-48054ae8fc34::yjqnbfn59qs26krwt9pubyaht: "/heat-stack": not found

Oh actually, maybe this is working:
fly deploy --local-only -c heat-stack/fly.toml

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.

2 participants