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

hasura: init at 1.2.1 #75527

Merged
merged 1 commit into from May 7, 2020
Merged

hasura: init at 1.2.1 #75527

merged 1 commit into from May 7, 2020

Conversation

@offlinehacker
Copy link
Contributor

offlinehacker commented Dec 11, 2019

About

This package is based on https://github.com/input-output-hk/cardano-explorer/tree/master/nix/nixos/graphql-engine who should also get most of the credit

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
Notify maintainers

cc @ivan @domenkozar

@offlinehacker offlinehacker changed the title hasura: init at 1.0.0-rc.1 [Draft] hasura: init at 1.0.0-rc.1 Dec 11, 2019
@offlinehacker offlinehacker force-pushed the xtruder:hasura branch 3 times, most recently from 6311b28 to 9f4015d Dec 11, 2019
@ofborg ofborg bot requested a review from ehmry Dec 11, 2019
@offlinehacker offlinehacker force-pushed the xtruder:hasura branch 2 times, most recently from 9b0813a to 6533798 Dec 11, 2019
@offlinehacker offlinehacker marked this pull request as ready for review Dec 12, 2019
@offlinehacker offlinehacker changed the title [Draft] hasura: init at 1.0.0-rc.1 hasura: init at 1.0.0-rc.1 Dec 12, 2019
@offlinehacker offlinehacker force-pushed the xtruder:hasura branch 2 times, most recently from 4f5256f to 18a07de Dec 12, 2019
@offlinehacker
Copy link
Contributor Author

offlinehacker commented Dec 12, 2019

Everything works as expected now. To test it locally:

nix-env -iA postgresql hasura-graphql-engine hasura-cli
mkdir -p postgres
initdb -D $PWD/hasuradb -A md5 -U root -W
postgres -D $PWD/hasuradb -k $PWD
createdb -h localhost hasura
graphql-engine --database-url=postgres://root:pass@localhost:5432/hasura serve
hasura console
pkgs/servers/hasura/cli.nix Outdated Show resolved Hide resolved
pkgs/top-level/all-packages.nix Outdated Show resolved Hide resolved
@offlinehacker offlinehacker force-pushed the xtruder:hasura branch from 18a07de to 30ab542 Dec 19, 2019
@offlinehacker offlinehacker changed the title hasura: init at 1.0.0-rc.1 hasura: init at 1.0.0 Dec 19, 2019
@offlinehacker
Copy link
Contributor Author

offlinehacker commented Dec 19, 2019

Updated to version 1.0.0, which was just released :)

@offlinehacker offlinehacker requested a review from danbst Dec 19, 2019
@offlinehacker
Copy link
Contributor Author

offlinehacker commented Dec 19, 2019

Can confirm version 1.0.0 working locally.

@elohmeier
Copy link
Contributor

elohmeier commented Feb 10, 2020

After rebasing onto master (0e6ceb8 as of writing) the build for graphql-engine fails:

Building library for graphql-engine-1.0.0..
...
[ 54 of 145] Compiling Hasura.HTTP      ( src-lib/Hasura/HTTP.hs, dist/build/Hasura/HTTP.o )
[ 55 of 145] Compiling Hasura.Server.CheckUpdates ( src-lib/Hasura/Server/CheckUpdates.hs, dist/build/Hasura/Server/CheckUpdates.o )
[ 56 of 145] Compiling Network.URI.Extended ( src-lib/Network/URI/Extended.hs, dist/build/Network/URI/Extended.o )

src-lib/Network/URI/Extended.hs:29:10: error:
    Duplicate instance declarations:
      instance Lift URI
        -- Defined at src-lib/Network/URI/Extended.hs:29:10
      instance [safe] Lift URI -- Defined in ‘Network.URI’
   |
29 | instance Lift URI
   |          ^^^^^^^^

builder for '/nix/store/5hb8n3ybiaffr0wjs17j4nilkasg3qqi-graphql-engine-1.0.0.drv' failed with exit code 1

I was able to build and run (on your branch) before rebasing successfully.

@bram209
Copy link

bram209 commented Feb 23, 2020

I would like to use this, is there anything I can do to help getting this PR merged?

@domenkozar
Copy link
Member

domenkozar commented Feb 24, 2020

@GrahamcOfBorg build hasura-cli

@domenkozar
Copy link
Member

domenkozar commented Feb 24, 2020

@offlinehacker could you rebase?

@offlinehacker offlinehacker force-pushed the xtruder:hasura branch from 30ab542 to dedf7a6 Mar 31, 2020
@offlinehacker offlinehacker changed the title hasura: init at 1.0.0 hasura: init at 1.1.1 Mar 31, 2020
@offlinehacker
Copy link
Contributor Author

offlinehacker commented Mar 31, 2020

Ok, this was quite a challenge, but was able to update to 1.1.1 and rebase package. I had learned quite a bit about haskell packaging, and also described in default.nix how i generated some files. It's still quite a manual process to get all the versions right, but i think (and hope) it should not break on update of haskell packages.

I can confirm that executables run, but i did not do any additional testing yet. So if someone has time it would be nice to check if everything works as expected.

@offlinehacker
Copy link
Contributor Author

offlinehacker commented Mar 31, 2020

@GrahamcOfBorg build hasura-graphql-engine hasura-cli

@ofborg ofborg bot requested a review from kalbasit Apr 1, 2020
@elohmeier
Copy link
Contributor

elohmeier commented Apr 15, 2020

Thanks for the updated PR, @offlinehacker. I've just tested the graphql-engine and the hasura console with a development project, everything works as expected.

@domenkozar
Copy link
Member

domenkozar commented Apr 15, 2020

I didn't have time to dig in, but those package should be coming from haskellPackages unless they are not on hackage. @offlinehacker did you check?

@offlinehacker
Copy link
Contributor Author

offlinehacker commented Apr 16, 2020

@domenkozar the problem is hasura is quite picky about some package versions(or it does not build) and haskellPackages only have one version, so for all version constrained dependencies that require older versions, I cannot use one from haskellPackages. This also seems one of limitation of haskellPackages, as it asumes only one version of package. Regardless of that I still managed to build hasura, but is not completely automated process, as alternative would probably generate a large file with dependencies, and that's not desirable in nixpkgs, which are already polluted with large auto generated files. Also three packages used by hasura are not on hackage.

pkgs/servers/hasura/graphql-engine.nix Outdated Show resolved Hide resolved
@offlinehacker
Copy link
Contributor Author

offlinehacker commented Apr 23, 2020

I will rebase and rebuild tomorrow, if everything still works let's merge.

@offlinehacker offlinehacker force-pushed the xtruder:hasura branch from dedf7a6 to 823cbc7 May 7, 2020
@offlinehacker offlinehacker changed the title hasura: init at 1.1.1 hasura: init at 1.2.1 May 7, 2020
@offlinehacker
Copy link
Contributor Author

offlinehacker commented May 7, 2020

Updated to 1.2.1 and tested locally, everything seems to work. I will merge after @GrahamcOfBorg builds pass.

@offlinehacker offlinehacker force-pushed the xtruder:hasura branch from 823cbc7 to 9a8454a May 7, 2020
@offlinehacker
Copy link
Contributor Author

offlinehacker commented May 7, 2020

@GrahamcOfBorg build hasura-graphql-engine hasura-cli

@offlinehacker offlinehacker merged commit 2c58b1d into NixOS:master May 7, 2020
15 of 16 checks passed
15 of 16 checks passed
hasura-cli, hasura-graphql-engine on aarch64-linux
Details
Evaluation Performance Report Evaluator Performance Report
Details
grahamcofborg-eval ^.^!
Details
grahamcofborg-eval-check-maintainers matching changed paths to changed attrs...
Details
grahamcofborg-eval-check-meta config.nix: checkMeta = true
Details
grahamcofborg-eval-darwin nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="9a8454a"; rev="9a8454a7a9e10a6e5d789b4049faa3876c1db3df"; } ./pkgs/t
Details
grahamcofborg-eval-lib-tests nix-build --arg pkgs import ./. {} ./lib/tests/release.nix
Details
grahamcofborg-eval-nixos nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="9a8454a"; rev="9a8454a7a9e10a6e5d789b4049faa3876c1db3df"; } ./nixos/
Details
grahamcofborg-eval-nixos-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="9a8454a"; rev="9a8454a7a9e10a6e5d789b4049faa3876c1db3df"; } ./nixos/
Details
grahamcofborg-eval-nixos-options nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="9a8454a"; rev="9a8454a7a9e10a6e5d789b4049faa3876c1db3df"; } ./nixos/
Details
grahamcofborg-eval-nixpkgs-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="9a8454a"; rev="9a8454a7a9e10a6e5d789b4049faa3876c1db3df"; } ./pkgs/t
Details
grahamcofborg-eval-nixpkgs-tarball nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="9a8454a"; rev="9a8454a7a9e10a6e5d789b4049faa3876c1db3df"; } ./pkgs/t
Details
grahamcofborg-eval-nixpkgs-unstable-jobset nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="9a8454a"; rev="9a8454a7a9e10a6e5d789b4049faa3876c1db3df"; } ./pkgs/t
Details
grahamcofborg-eval-package-list nix-env -qa --json --file .
Details
grahamcofborg-eval-package-list-no-aliases nix-env -qa --json --file . --arg config { allowAliases = false; }
Details
hasura-cli, hasura-graphql-engine on x86_64-linux Success
Details
@hgiasac
Copy link

hgiasac commented May 30, 2020

@offlinehacker Several things need to be changed:

  • New Hasura CLI (from 1.2.0) has extension plugin that is installed into ~/.hasura/plugins/bin/hasura-cli_ext when run hasura. This breaking change is due to new feature of v2 migration and action plugins.

This extension binary requires libstdc++.so.6 library.

ldd ~/.hasura/plugins/bin/hasura-cli_ext

linux-vdso.so.1 (0x00007ffd2cbeb000)
        libdl.so.2 => /nix/store/nwsn18fysga1n5s0bj4jp4wfwvlbx8b1-glibc-2.30/lib/libdl.so.2 (0x00007f42c6e18000)
        librt.so.1 => /nix/store/nwsn18fysga1n5s0bj4jp4wfwvlbx8b1-glibc-2.30/lib/librt.so.1 (0x00007f42c6e0e000)
        libstdc++.so.6 => not found
        libm.so.6 => /nix/store/nwsn18fysga1n5s0bj4jp4wfwvlbx8b1-glibc-2.30/lib/libm.so.6 (0x00007f42c6cce000)
        libgcc_s.so.1 => /nix/store/nwsn18fysga1n5s0bj4jp4wfwvlbx8b1-glibc-2.30/lib/libgcc_s.so.1 (0x00007f42c6cb4000)
        libpthread.so.0 => /nix/store/nwsn18fysga1n5s0bj4jp4wfwvlbx8b1-glibc-2.30/lib/libpthread.so.0 (0x00007f42c6c93000)
        libc.so.6 => /nix/store/nwsn18fysga1n5s0bj4jp4wfwvlbx8b1-glibc-2.30/lib/libc.so.6 (0x00007f42c6ad2000)
        /lib64/ld-linux-x86-64.so.2 => /nix/store/nwsn18fysga1n5s0bj4jp4wfwvlbx8b1-glibc-2.30/lib64/ld-linux-x86-64.so.2 (0x00007f42c6e1f000)

The CLI still works with SQL migrations, but metadata doesn't. New commands such as action generator don't work too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

6 participants
You can’t perform that action at this time.