-
Notifications
You must be signed in to change notification settings - Fork 49
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
chore: build the Haskell parts with haskell.nix #537
base: master
Are you sure you want to change the base?
chore: build the Haskell parts with haskell.nix #537
Conversation
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.
Great work @michalrus 🦾
It would be better to make the binary cache opt-in behind a Docker build arg, to better align with the Rosetta spec intent.
2ce9fe5
to
0e71213
Compare
Okay, I think I made everything work now (including ARM builds! 🍎):
|
@@ -178,26 +132,28 @@ COPY cardano-rosetta-server/package.json \ | |||
cardano-rosetta-server/yarn.lock \ | |||
cardano-rosetta-server/.yarnrc \ | |||
/app/ | |||
RUN chmod -R g+rX,o+rX /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.
These chmod
s are necessary in case the user running docker build
has umask 0077
on the repository source
ENV PGPASSFILE=/config/cardano-db-sync/pgpass | ||
RUN echo "/var/run/postgresql:5432:cexplorer:*:*" > $PGPASSFILE &&\ | ||
RUN echo "/var/run/postgresql:5432:cexplorer:postgres:*" > $PGPASSFILE &&\ |
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 one was tricky, if we set the username part to *
, we get ENOTTY
in cardano-db-sync
:
- https://hackage.haskell.org/package/unix-2.8.2.1/docs/src/System.Posix.User.ByteString.html#getUserEntryForID
- called from https://hackage.haskell.org/package/unix-2.8.2.1/docs/src/System.Posix.User.ByteString.html#getEffectiveUserName
- called from https://github.com/input-output-hk/cardano-db-sync/blob/eed3af193714536a32b745db04c56e4d501ee929/cardano-db/src/Cardano/Db/PGConfig.hs#L109
- called from
cardano-db-sync
This is a workaround, and should probably be investigated properly, I reported it to @sgillespie (DevX)
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.
Reference: IntersectMBO/cardano-db-sync#1528
@@ -17,8 +17,9 @@ module.exports = { | |||
}, | |||
{ | |||
name: 'cardano-node', | |||
script: '/usr/local/bin/cardano-node', | |||
script: '/bin/sh', |
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.
It’s no longer an ELF, so PM2 can’t recognize it correctly (if it’s not an ELF, it assumes it’s JavaScript)
Fixed in 3eb8d5b. |
Description
We discovered with @rhyslbw that the current
master
no longer builds (fails on Haskell compilation), so the build process is not very reproducible.Proposed Solution
Let’s reuse the 100% reproducible build definitions signed off by the
cardano-node
team. For bothcardano-node
, andcardano-db-sync
.Node’s build process is too complicated and fragile, and it's very hard to reproduce it reliably here. We can just use their definitions, which work, and are used in official releases.
We also have an option to disable the IOG binary cache, and build the world from source (see a comment added inside the
Dockerfile
).Important Changes Introduced
The external interface doesn’t change.
Testing
The external interface doesn’t change.