-
Notifications
You must be signed in to change notification settings - Fork 3
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
local dev env #1
Conversation
Getting an error during docker build:
|
We're using a very recent version of Node (20), but the packages we use are built for previous versions (<14), so we don't have precompiled binaries and the Node ABI is different to compile them, we should upgrade those packages or downgrade Node. |
This one could be fixed by installing the right headers (going to try that) but the thing I'm confused about is @gravityblast is not getting the same error despite also building in Docker. |
Installing the dependency did fix that particular error but only to expose the next one, which looks of the sort that @boudra mentioned:
|
|
Funnily, I get this when running under docker-compose instead of plain docker:
I can share the compose file, but if the above rings any bells @gravityblast please let me know |
ff779da
to
723b05c
Compare
I missed this message, so let's keep it and I'll fix it like you did! |
yes if you can share it I can try |
@bard I just pushed the node-hid override |
There was once a build that seemed to only fail on my laptop. And then we moved from Fleek to Vercel. |
Pushed to the https://github.com/gitcoinco/allo-contracts-v1/tree/dev-env-compose branch |
I meant a new action I added to build the docker image and push it to ghcr https://github.com/gitcoinco/allo-contracts-v1/actions/runs/6567652555/job/17840749412 |
And I meant the risk of taking "it builds in environment X" as sign that all is good. :) |
no of course, I was pointing out that there it worked and it makes sense to understand what we need to fix, not the "it works here™" |
ah ok now I understand your docker-compose problem. The script was meant to be used with
|
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to GHCR
uses: docker/login-action@v1
with:
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker images
uses: docker/build-push-action@v2
with:
context: .
file: ./docker/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: gitcoinco/allo-contracts-v1:latest remember to give access to GA to write packages |
c5554a0
to
fabc307
Compare
…ins configurations
I moved the Dockerfile to the root folder and now buildx works |
f320818
to
1f94526
Compare
Dockerfile
Outdated
@@ -0,0 +1,25 @@ | |||
FROM node:20-slim | |||
|
|||
RUN apt-get clean && \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the purpose is reducing image size, this should come after apt-get install
so that the image doesn't contain cached packages.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch thank you I'm updating it
Dockerfile
Outdated
apt-get update && \ | ||
apt-get install -y python3 curl git build-essential psmisc | ||
|
||
COPY ../ /app |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the Dockerfile being now in the root folder, is../
still referring to the correct folder?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch I forgot it from the previous position of the dockerfile
scripts/dev/populate/projects.ts
Outdated
return data; | ||
} | ||
|
||
async function uploadJSONToPinata(content: any) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is missing a declaration for the return type so there's a risk of returning something unintended and only noticing at call sites. (Same for other functions below.)
for (let i = 1; i < 4; i++) { | ||
let metadataCid = ""; | ||
|
||
if (pinataBaseUrl !== undefined) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sanity check: do we want the development environment to be usable without pinata?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not in grants stack where we set that env, but it might be useful to use only contracts if you are using this image to debug contracts only
This PR allows to run a local chain using a docker container with scripts to deploy contracts and populate them with test data.
The population part is just a test, and for now it adds only one project. In the next PR we will create more data including rounds, applications, etc...
The current work includes
dev
network configuration with deterministic contract addresses