-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Correctly install deps into sppl container
- Python site packages - JDK modules
- Loading branch information
Showing
8 changed files
with
89 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,3 +34,8 @@ jobs: | |
-L \ | ||
-o ./imgTarball \ | ||
'.#ociImg' | ||
- run: | | ||
nix build \ | ||
-L \ | ||
-o ./imgTarball \ | ||
'.#ociImgSppl' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,15 @@ | ||
{ pkgs, | ||
system, | ||
uber, | ||
pname, | ||
... | ||
}: import ./with_extra_deps.nix { inherit pkgs uber pname; extraDeps = []; } | ||
pname | ||
}: pkgs.stdenv.mkDerivation { | ||
name = "gensql.query"; | ||
inherit pname; | ||
src = ./.; | ||
nativeBuildInputs = [ pkgs.makeWrapper ]; | ||
buildInputs = [ pkgs.openjdk17 ]; | ||
installPhase = '' | ||
makeWrapper ${pkgs.openjdk17}/bin/java $out/bin/${pname} \ | ||
--add-flags "-jar ${uber}" | ||
''; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
{ pkgs, | ||
nixpkgs, | ||
system, | ||
opengen, | ||
uber, | ||
pname, | ||
basicToolsFn, | ||
depsCache, | ||
}: let | ||
# in OCI context, whatever our host platform we want to build same arch but linux | ||
systemWithLinux = builtins.replaceStrings [ "darwin" ] [ "linux" ] system; | ||
|
||
crossPkgsLinux = nixpkgs.legacyPackages.${systemWithLinux}; | ||
|
||
# TODO: This can be factored out into an gensql/nix | ||
# shared package. | ||
baseImg = opengen.packages.${system}.ociImgBase; | ||
|
||
sppl = opengen.packages.${systemWithLinux}.sppl; | ||
python = opengen.packages.${systemWithLinux}.sppl.runtimePython; | ||
|
||
ociBin = crossPkgsLinux.callPackage ./../bin/gpm-sppl.nix { | ||
inherit | ||
uber | ||
opengen | ||
pname | ||
; | ||
}; | ||
in pkgs.dockerTools.buildLayeredImage { | ||
name = "probcomp/gensql.query"; | ||
tag = systemWithLinux; | ||
fromImage = baseImg; | ||
# architecture | ||
contents = [ ociBin depsCache crossPkgsLinux.clojure sppl python]; | ||
config = { | ||
Cmd = [ "${ociBin}/bin/${pname}" ]; | ||
Env = [ | ||
"CLJ_CONFIG=${depsCache}/.clojure" | ||
"GITLIBS=${depsCache}/.gitlibs" | ||
"JAVA_TOOL_OPTIONS=-Duser.home=${depsCache}" | ||
"JDK_JAVA_OPTIONS=--add-modules jdk.incubator.foreign,jdk.incubator.vector --enable-native-access=ALL-UNNAMED" | ||
"PYTHONPATH=${python.sitePackages}" | ||
]; | ||
}; | ||
} | ||
|
||
|
||
|