refactor: upgrade to Hasura 2
- switch to a haskell.nix build of graphql-engine v2
- switch to a haskell.nix build of graphql-engine v2
RUN apk add curl
RUN curl --proto '=https' --tlsv1.2 -sSf -L https://github.com/hasura/graphql-engine/raw/stable/cli/get.sh | sh
ENV HASURA_GRAPHQL_ENABLE_TELEMETRY=false
RUN hasura --skip-update-check update-cli --version v1.3.3
RUN hasura --skip-update-check update-cli --version v2.15.0
RUN hasura --skip-update-check plugins install cli-ext
FROM nodejs-builder as dev
{
"nodes": {
"HTTP": {
"flake": false,
"locked": {
"lastModified": 1451647621,
"narHash": "sha256-oHIyw3x0iKBexEo49YeUDV1k74ZtyYKGR2gNJXXRxts=",
"owner": "phadej",
"repo": "HTTP",
"rev": "9bc0996d412fef1787449d841277ef663ad9a915",
"type": "github"
},
"original": {
"owner": "phadej",
"repo": "HTTP",
"type": "github"
}
},
"blank": {
"locked": {
"lastModified": 1625557891,
"type": "github"
}
},
"blank_2": {
"locked": {
"lastModified": 1625557891,
"narHash": "sha256-O8/MWsPBGhhyPoPLHZAuoZiiHo9q6FLlEeIDEXuj6T4=",
"owner": "divnix",
"repo": "blank",
"rev": "5a5d2684073d9f563072ed07c871d577a6c614a8",
"type": "github"
},
"original": {
"owner": "divnix",
"repo": "blank",
"type": "github"
}
},
"cabal-32": {
"flake": false,
"locked": {
"lastModified": 1603716527,
"narHash": "sha256-X0TFfdD4KZpwl0Zr6x+PLxUt/VyKQfX7ylXHdmZIL+w=",
"owner": "haskell",
"repo": "cabal",
"rev": "48bf10787e27364730dd37a42b603cee8d6af7ee",
"type": "github"
},
"original": {
"owner": "haskell",
"ref": "3.2",
"repo": "cabal",
"type": "github"
}
},
"cabal-34": {
"flake": false,
"locked": {
"lastModified": 1640353650,
"narHash": "sha256-N1t6M3/wqj90AEdRkeC8i923gQYUpzSr8b40qVOZ1Rk=",
"owner": "haskell",
"repo": "cabal",
"rev": "942639c18c0cd8ec53e0a6f8d120091af35312cd",
"type": "github"
},
"original": {
"owner": "haskell",
"ref": "3.4",
"repo": "cabal",
"type": "github"
}
},
"cabal-36": {
"flake": false,
"locked": {
"lastModified": 1641652457,
"narHash": "sha256-BlFPKP4C4HRUJeAbdembX1Rms1LD380q9s0qVDeoAak=",
"owner": "haskell",
"repo": "cabal",
"rev": "f27667f8ec360c475027dcaee0138c937477b070",
"type": "github"
},
"original": {
"owner": "haskell",
"ref": "3.6",
"repo": "cabal",
"type": "github"
}
},
"cardano-shell": {
"flake": false,
"locked": {
"lastModified": 1608537748,
"narHash": "sha256-PulY1GfiMgKVnBci3ex4ptk2UNYMXqGjJOxcPy2KYT4=",
"owner": "input-output-hk",
"repo": "cardano-shell",
"rev": "9392c75087cb9a3d453998f4230930dea3a95725",
"type": "github"
},
"original": {
"owner": "input-output-hk",
"repo": "cardano-shell",
"type": "github"
}
},
"ci-info-hs": {
"flake": false,
"locked": {
"lastModified": 1608563827,
"narHash": "sha256-m2mxYqQphXeiu9YyZ3RgyRT9xDEIT52ScI7vSWqvYFc=",
"owner": "hasura",
"repo": "ci-info-hs",
"rev": "be578a01979fc95137cc2c84827f9fafb99df60f",
"type": "github"
},
"original": {
"owner": "hasura",
"repo": "ci-info-hs",
"rev": "be578a01979fc95137cc2c84827f9fafb99df60f",
"type": "github"
}
},
"devshell": {
"inputs": {
"flake-utils": [
"haskellNix",
"tullia",
"std",
"flake-utils"
],
"nixpkgs": [
"haskellNix",
"tullia",
"std",
"nixpkgs"
]
},
"locked": {
"lastModified": 1663445644,
"narHash": "sha256-+xVlcK60x7VY1vRJbNUEAHi17ZuoQxAIH4S4iUFUGBA=",
"owner": "numtide",
"repo": "devshell",
"rev": "e3dc3e21594fe07bdb24bdf1c8657acaa4cb8f66",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "devshell",
"type": "github"
}
},
"devshell_2": {
"inputs": {
"flake-utils": [
"tullia",
}
},
"dmerge": {
"inputs": {
"nixlib": [
"haskellNix",
"tullia",
"std",
"nixpkgs"
],
"yants": [
"haskellNix",
"tullia",
"std",
"yants"
]
},
"locked": {
"lastModified": 1659548052,
"narHash": "sha256-fzI2gp1skGA8mQo/FBFrUAtY0GQkAIAaV/V127TJPyY=",
"owner": "divnix",
"repo": "data-merge",
"rev": "d160d18ce7b1a45b88344aa3f13ed1163954b497",
"type": "github"
},
"original": {
"owner": "divnix",
"repo": "data-merge",
"type": "github"
}
},
"dmerge_2": {
"inputs": {
"nixlib": [
"tullia",
"type": "github"
}
},
"ekg-core": {
"flake": false,
nixpkgs.follows = "tullia/nixpkgs";
std.follows = "tullia/std";
tullia.url = github:input-output-hk/tullia;
flake-compat = {
url = "github:input-output-hk/flake-compat/fixes";
flake = false;
};
haskellNix = {
url = github:input-output-hk/haskell.nix/fix-input-map-support-with-no-rev;
};
graphql-engine = {
url = github:hasura/graphql-engine/v2.16.1;
};
# graphql-engine dependencies:
kriti-lang = {
url = github:hasura/kriti-lang/c8fd863d359876af3a0fce47db8a5393dc556667;
flake = false;
};
ci-info-hs = {
url = github:hasura/ci-info-hs/be578a01979fc95137cc2c84827f9fafb99df60f;
flake = false;
};
pool = {
url = github:hasura/pool/c5faf9a358e83eaf15fef0c1e890f463d0022565;
flake = false;
};
odbc = {
url = github:fpco/odbc/38e04349fe28a91f189e44bd7783220956d18aae;
flake = false;
};
ekg-core = {
url = github:hasura/ekg-core/b0cdc337ca2a52e392d427916ba3e28246b396c0;
flake = false;
};
ekg-prometheus = {
url = github:hasura/ekg-prometheus/v0.2.0.0;
flake = false;
};
ekg-json = {
url = github:hasura/ekg-json/1fab6837e1dd98317a3c2f5bf9deedf4dfcac51b;
flake = false;
};
text = {
url = github:hasura/text/ba0fd2bf256c996a6c85dbdc8590a6fcde41b8f8;
flake = false;
};
};
outputs = {
cellsFrom = nix/cells;
cellBlocks = [
(std.functions "library")
(std.installables "packages")
(std.functions "hydraJobs")
(tullia.tasks "pipelines")
(std.functions "actions")
stdenv.mkDerivation rec {
pname = "hasura-cli-ext";
version = "1.3.3";
version = "2.0.0-alpha.4";
src = fetchurl {
url = "https://github.com/hasura/graphql-engine/releases/download/v${version}/cli-ext-hasura-linux.tar.gz";
sha256 = "0a49w1lb3j33i8yz232inr7lm8j6vxg6y52izljnn71w2l25mqlw";
sha256 = "sha256-vblQFASVnEtCQ5G6WLI5ssbxIKtCjarLpsb4KI9z0Zc=";
};
sourceRoot = ".";
buildPhase = ":";
{ buildGoModule, hasura-cli, src }:
buildGoModule (rec {
inherit (hasura-cli.drvAttrs) pname modRoot subPackages doCheck postInstall;
inherit (hasura-cli) meta;
inherit src;
name = "hasura-${version}";
version = "2.16.1";
buildFlagsArray = [''-ldflags=
-X github.com/hasura/graphql-engine/cli/version.BuildVersion=${version}
-s
-w
''];
vendorSha256 = "sha256-vZKPVQ/FTHnEBsRI5jOT6qm7noGuGukWpmrF8fK0Mgs=";
})
{
haskell-nix,
src,
inputs,
}: let
inherit (haskell-nix) haskellLib;
in
haskell-nix.cabalProject' ({
config,
pkgs,
lib,
...
}: {
name = "graphql-engine";
# default-compiler
compiler-nix-name = lib.mkDefault "ghc925";
inherit src;
inputMap = {
"https://github.com/hasura/kriti-lang.git" = inputs.kriti-lang;
"https://github.com/hasura/ci-info-hs.git" = inputs.ci-info-hs;
"https://github.com/hasura/pool.git" = inputs.pool;
"https://github.com/fpco/odbc.git" = inputs.odbc;
"https://github.com/hasura/ekg-core.git" = inputs.ekg-core;
"https://github.com/hasura/ekg-prometheus.git/v0.2.0.0" = inputs.ekg-prometheus;
"https://github.com/hasura/ekg-json.git" = inputs.ekg-json;
"https://github.com/hasura/text.git" = inputs.text;
};
modules = [{
packages.mysql.components.library.build-tools = [pkgs.libmysqlclient];
packages.mysql-simple.components.library.build-tools = [ pkgs.zlib pkgs.openssl_3 ];
packages.graphql-engine.components.library.preBuild = ''echo 2.16.1 > CURRENT_VERSION'';
packages.graphql-engine.components.library.build-tools = [ pkgs.zlib pkgs.openssl_3 ];
packages.graphql-engine.components.exes.graphql-engine.build-tools = [ pkgs.zlib pkgs.openssl_3 ];
packages.graphql-engine.components.exes.emit-metadata-openapi.build-tools = [ pkgs.zlib pkgs.openssl_3 ];
}];
})
{
cell,
inputs,
}: let
inherit (inputs.nixpkgs) lib;
inherit (inputs.haskellNix.legacyPackages) haskell-nix;
graphql-engine-project = import ./graphql-engine-project.nix {
inherit haskell-nix inputs;
src = inputs.graphql-engine;
};
in {
inherit graphql-engine-project;
}
{
inputs,
cell,
}: let
inherit (inputs) nixpkgs;
in {
inherit (cell.library.graphql-engine-project.hsPkgs.graphql-engine.components.exes) graphql-engine emit-metadata-openapi;
inherit (inputs.graphql-engine.packages) graphql-parser;
hasura-cli = nixpkgs.callPackage ./cli.nix {
src = inputs.graphql-engine;
};
hasura-cli-ext = nixpkgs.callPackage ./cli-ext.nix {};
}
let
src = ../.;
lock = builtins.fromJSON (builtins.readFile (src + "/flake.lock"));
flake-compate-input = lock.nodes.root.inputs.flake-compat;
nixpkgs-input = lock.nodes.root.inputs.nixpkgs;
flake-compat = import (builtins.fetchTree lock.nodes.${flake-compate-input}.locked);
pkgs = import (builtins.fetchTree lock.nodes.${nixpkgs-input}.locked) { };
in
flake-compat {
inherit src pkgs;
}
{ haskell, sources, postgresql, openssl }:
self: super: {
ci-info = haskell.lib.dontHaddock (haskell.lib.dontCheck (super.ci-info.overrideAttrs (_: {
src = sources.ci-info-hs;
})));
graphql-engine = haskell.lib.dontHaddock (haskell.lib.dontCheck (super.graphql-engine.overrideAttrs (_: {
src = sources.graphql-engine;
name = "graphql-engine-1.3.3";
})));
graphql-parser = haskell.lib.dontHaddock (haskell.lib.dontCheck (super.graphql-parser.overrideAttrs (_: {
src = sources.graphql-parser-hs;
prePatch = "hpack --force";
})));
pg-client = haskell.lib.dontHaddock (haskell.lib.dontCheck (super.pg-client.overrideAttrs (attrs: {
src = sources.pg-client-hs;
nativeBuildInputs = attrs.nativeBuildInputs ++ [ postgresql ];
buildInputs = attrs.buildInputs ++ [ openssl ];
})));
}
{ pkgs, lib }:
let
packages = self: {
hasuraPackages = (import ./flake-compat.nix).defaultNix.${pkgs.system}.hasura.packages;
packages = self: hasuraPackages // {
nix-inclusive = pkgs.callPackage "${pkgs.sources.nix-inclusive}/inclusive.nix" {};
cardano-graphql = self.callPackage ./cardano-graphql.nix {};
hasura-cli-ext = self.callPackage ./hasura-cli-ext/impure.nix {};
persistgraphql = (self.callPackage ./persistgraphql { nodejs = pkgs.nodejs-14_x; }).persistgraphql;
hasura-cli = pkgs.hasura-cli.overrideAttrs (_: rec {
src = pkgs.sources.graphql-engine;
name = "hasura-${version}";
version = "1.3.3";
buildFlagsArray = [''-ldflags=
-X github.com/hasura/graphql-engine/cli/version.BuildVersion=${version}
-s
-w
''];
});
vgo2nix = pkgs.vgo2nix;
hasuraHaskellPackages = pkgs.haskell.packages.ghc8102.override {
overrides = import ./graphql-engine/hs-overlay.nix { inherit (pkgs) haskell sources postgresql openssl; };
};
graphql-engine = pkgs.haskell.lib.justStaticExecutables self.hasuraHaskellPackages.graphql-engine;
};
in lib.makeScope pkgs.newScope packages
FROM hasura/graphql-engine:v1.3.3.cli-migrations-v2
FROM hasura/graphql-engine:v2.15.2.cli-migrations-v2
COPY docker-entrypoint.sh /bin/
ENV \
POSTGRES_HOST=postgres \
POSTGRES_DB=${POSTGRES_DB:-$(cat ${SECRET_DIR}/postgres_db)}
POSTGRES_USER=${POSTGRES_USER:-$(cat ${SECRET_DIR}/postgres_user)}
POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-$(cat ${SECRET_DIR}/postgres_password)}
HASURA_GRAPHQL_DATABASE_URL=postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}
exec graphql-engine \
--database-url $HASURA_GRAPHQL_DATABASE_URL \
serve
export HASURA_GRAPHQL_DATABASE_URL=postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}
exec graphql-engine serve
version: 2
version: 3
endpoint: http://localhost:8091
api_paths:
v1_query: v1/query
v2_query: v2/query
v1_metadata: v1/metadata
graphql: v1/graphql
config: v1alpha1/config
pg_dump: v1alpha1/pg_dump
version: v1/version
metadata_directory: metadata
migrations_directory: migrations
seeds_directory: seeds
actions:
kind: synchronous
handler_webhook_baseurl: http://localhost:3000
codegen:
framework: ""
output_dir: ""
{}
- name: default
kind: postgres
configuration:
connection_info:
database_url:
from_env: HASURA_GRAPHQL_DATABASE_URL
isolation_level: read-committed
pool_settings:
connection_lifetime: 600
idle_timeout: 180
max_connections: 50
retries: 1
use_prepared_statements: true
tables: "!include default/tables/tables.yaml"
\ No newline at end of file
table:
name: ActiveStake
schema: public
configuration:
column_config: {}
custom_column_names: {}
custom_root_fields:
select: activeStake
select_aggregate: activeStake_aggregate
object_relationships:
- name: epoch
using:
manual_configuration:
column_mapping:
epochNo: number
insertion_order: null
remote_table:
name: Epoch
schema: public
- name: registeredWith
using:
manual_configuration:
column_mapping:
stakePoolHash: hash
insertion_order: null
remote_table:
name: StakePool
schema: public
select_permissions:
- role: cardano-graphql
permission:
columns:
- address
- amount
- epochNo
- stakePoolHash
- stakePoolId
filter: {}
limit: 2500
allow_aggregations: true
table:
name: AdaPots
schema: public
select_permissions:
- role: cardano-graphql
permission:
columns:
- deposits
- fees
- reserves
- rewards
- slotNo
- treasury
- utxo
filter: {}
allow_aggregations: true
table:
name: Asset
schema: public
configuration:
column_config: {}
custom_column_names: {}
custom_root_fields:
delete: delete_assets
insert: insert_assets
select: assets
select_aggregate: assets_aggregate
update: update_assets
object_relationships:
- name: firstAppearedInBlock
using:
manual_configuration:
column_mapping:
firstAppearedInSlot: slotNo
insertion_order: null
remote_table:
name: Block
schema: public
array_relationships:
- name: tokenMints
using:
manual_configuration:
column_mapping:
assetName: assetName
policyId: policyId
insertion_order: null
remote_table:
name: TokenMint
schema: public
insert_permissions:
- role: cardano-graphql
permission:
check: {}
columns:
- assetId
- assetName
- decimals
- description
- fingerprint
- firstAppearedInSlot
- logo
- metadataHash
- name
- policyId
- ticker
- url
select_permissions:
- role: cardano-graphql
permission:
columns:
- assetId
- assetName
- policyId
- fingerprint
- metadataHash
- description
- logo
- name
- ticker
- url
- decimals
- firstAppearedInSlot
filter: {}
limit: 2500
allow_aggregations: true
update_permissions:
- role: cardano-graphql
permission:
columns:
- assetId
- assetName
- policyId
- fingerprint
- metadataHash
- description
- logo
- name
- ticker
- url
- decimals
- firstAppearedInSlot
filter: {}
check: {}
delete_permissions:
- role: cardano-graphql
permission:
backend_only: false
filter: {}
Adding Milkomeda Open Oracle dev guide
3815: Cleanup nix setup: remove unused cabal shell r=Unisay a=Unisay ### Overview This pull request cleans up our `flake.nix` configuration by * removing the unused `cabal-shell.nix` * making explicit which shell is created when doing `nix develop` (it's `ā¦.devShells.default`). ### Issue Number ADP-2447 Co-authored-by: Yura Lazarev <[email protected]>
fix CI not running on bors branches
5023: fix CI not running on bors branches r=disassembler a=dermetfan Looks like this was broken in #4930 as `prAndBorsIo` was added but not used. Also removed `nix` from the task name. I do not see what purpose it has and it makes the names unnecessarily long. Also we happen to need the old names in #5018. Co-authored-by: Robin Stumm <[email protected]>
I don't trust it. Compare these two runs: 1. https://github.com/input-output-hk/cardano-haskell-packages/actions/runs/4532746158/jobs/7984714895 2. https://github.com/input-output-hk/cardano-haskell-packages/actions/runs/4516172089/jobs/7954255360 The second is on the parent commit of the first, the commit itself is a no-op, and yet the derivations they build are not the same! Doing the same locally, I get a) a different derivation, but b) the same derivation for both. I conclude that what the CI is doing is questionable, the cache seems like the most likely source of pollution. I suspect whatever is causing this was also responsible for the no-op PR spending a lot of time building tons of stuff.
* Update readme (cli flags, comment dsl, new format) * Document the comment DSL * Document CLI flags * Mention new split rust/wasm output structure * Remove unsupported section (to handle in issues instead as this tends to get very outdated) * respond to comments + add supported.cddl * minor fixes for comment placement in supported.cddl + remove unsupported optional fixed value from example
There's an issue with the `deriving via` clause for OneEraHeader: * `show`ing a `NS Header (CardanoEras StandardCrypto BatchCompatibleCrypto)` works fine * `show`ing a `OneEraHeader (CardanoEras ...)` yields the annoying error message about not being able to handle 2 different cryptos Using forAllBlind in the property removes the QC requirement to be able to `Show` the generated values which makes it work.