Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
fmaste authored and deepfire committed Nov 7, 2022
1 parent ed89334 commit 43b6b5d
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 8 deletions.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ NUM_PROC = $(nproc --all)
ERA ?= bage

PROFILE ?= default-${ERA}
BACKEND ?= supervisor
REV ?= master
ITER ?=
ARGS ?=
Expand Down Expand Up @@ -49,7 +50,7 @@ ci-targets: $(CI_TARGETS)
## Base targets:
##
shell: ## Nix shell, (workbench from /nix/store), vars: PROFILE, CMD, RUN
nix-shell -A 'workbench-shell' --max-jobs 8 --cores 0 --show-trace --argstr profileName ${PROFILE} ${ARGS} ${if ${CMD},--command "${CMD}"} ${if ${RUN},--run "${RUN}"}
nix-shell -A 'workbench-shell' --max-jobs 8 --cores 0 --show-trace --argstr profileName ${PROFILE} --argstr backendName ${BACKEND} ${ARGS} ${if ${CMD},--command "${CMD}"} ${if ${RUN},--run "${RUN}"}
shell-dev shell-prof shell-nix: shell
shell-nix: ARGS += --arg 'workbenchDevMode' false ## Nix shell, (workbench from Nix store), vars: PROFILE, CMD, RUN
shell-prof: ARGS += --arg 'profiled' true ## Nix shell, everything Haskell built profiled
Expand Down
1 change: 1 addition & 0 deletions nix/custom-config.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ self: {
stateDir = "run/current";
batchName = "plain";
profileName = "default-bage";
backendName = "supervisor";
basePort = 30000;
enableEKG = true;
workbenchDevMode = true;
Expand Down
1 change: 0 additions & 1 deletion nix/pkgs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ final: prev: with final; {
nomad-workbench-for-profile =
{ batchName ? customConfig.localCluster.batchName
, profileName ? customConfig.localCluster.profileName
# FIXME: Makes no sense for this backend!
, useCabalRun ? false
, workbenchDevMode ? false
, profiled ? false
Expand Down
2 changes: 2 additions & 0 deletions nix/workbench/backend/nomad.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ let
rec
{ name = "nomad";

useCabalRun = false;

services-config = import ./services-config.nix {inherit lib workbench basePort stateDir; useCabalRun = false; inherit enableEKG;};

extraShellPkgs = with pkgs; [
Expand Down
2 changes: 2 additions & 0 deletions nix/workbench/backend/supervisor.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ let
rec
{ name = "supervisor";

inherit useCabalRun;

services-config = import ./services-config.nix {inherit lib workbench basePort stateDir useCabalRun enableEKG;};

extraShellPkgs = with pkgs; [
Expand Down
15 changes: 10 additions & 5 deletions nix/workbench/shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
, cardano-mainnet-mirror
##
, profileName
, backendName
, workbenchDevMode ? false
, useCabalRun ? false
##
Expand All @@ -18,19 +19,23 @@

with lib;

let cluster = pkgs.nomad-workbench-for-profile {
inherit profileName useCabalRun profiled;
};
let cluster =
if backendName == "nomad"
then pkgs.nomad-workbench-for-profile
{ inherit profileName useCabalRun profiled; }
else pkgs.supervisord-workbench-for-profile
{ inherit profileName useCabalRun profiled; }
;

useCabalRun = false;
#useCabalRun = false;

inherit (cluster) backend profile;

shellHook = { workbenchDevMode, useCabalRun, profiled, profileName, withMainnet }: ''
while test $# -gt 0
do shift; done ## Flush argv[]
echo 'workbench shellHook: workbenchDevMode=${toString workbenchDevMode} useCabalRun=${toString useCabalRun} profiled=${toString profiled} profileName=${profileName}'
echo 'workbench shellHook: workbenchDevMode=${toString workbenchDevMode} useCabalRun=${toString useCabalRun} profiled=${toString profiled} backendName=${backendName} profileName=${profileName}'
export WB_BACKEND=${backend.name}
export WB_SHELL_PROFILE=${profileName}
export WB_SHELL_PROFILE_DIR=${profile}
Expand Down
3 changes: 2 additions & 1 deletion shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ let defaultCustomConfig = import ./nix/custom-config.nix defaultCustomConfig;
in
{ withHoogle ? defaultCustomConfig.withHoogle
, profileName ? defaultCustomConfig.localCluster.profileName
, backendName ? defaultCustomConfig.localCluster.backendName
, workbenchDevMode ? defaultCustomConfig.localCluster.workbenchDevMode
, useCabalRun ? true
, customConfig ? {
Expand Down Expand Up @@ -60,7 +61,7 @@ let
{ inherit pkgs lib haskellLib project;
inherit setLocale haveGlibcLocales commandHelp;
inherit cardano-mainnet-mirror;
inherit profileName workbenchDevMode useCabalRun;
inherit profileName backendName workbenchDevMode useCabalRun;
inherit profiled withHoogle;
};

Expand Down

0 comments on commit 43b6b5d

Please sign in to comment.