kopia lustrzana https://github.com/jupyterhub/repo2docker
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.cipull/1048/head
rodzic
8edfa530bf
commit
54c193fafd
|
@ -718,4 +718,3 @@ class BaseImage(BuildPack):
|
||||||
# the only path evaluated at container start time rather than build time
|
# the only path evaluated at container start time rather than build time
|
||||||
return os.path.join("${REPO_DIR}", start)
|
return os.path.join("${REPO_DIR}", start)
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
|
@ -9,9 +9,7 @@ class GuixBuildPack(BaseImage):
|
||||||
|
|
||||||
def get_build_env(self):
|
def get_build_env(self):
|
||||||
""""""
|
""""""
|
||||||
env = super().get_build_env() + [
|
env = super().get_build_env() + [("GUIX_DIR", "${APP_BASE}/guix")]
|
||||||
("GUIX_DIR", "${APP_BASE}/guix")
|
|
||||||
]
|
|
||||||
return env
|
return env
|
||||||
|
|
||||||
def get_path(self):
|
def get_path(self):
|
||||||
|
@ -20,8 +18,6 @@ class GuixBuildPack(BaseImage):
|
||||||
path.insert(0, "${GUIX_DIR}/bin")
|
path.insert(0, "${GUIX_DIR}/bin")
|
||||||
return path
|
return path
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def get_build_scripts(self):
|
def get_build_scripts(self):
|
||||||
"""
|
"""
|
||||||
Install a pinned version of Guix package manager,
|
Install a pinned version of Guix package manager,
|
||||||
|
@ -34,15 +30,13 @@ class GuixBuildPack(BaseImage):
|
||||||
bash /tmp/.local/bin/guix-install.bash
|
bash /tmp/.local/bin/guix-install.bash
|
||||||
""",
|
""",
|
||||||
),
|
),
|
||||||
|
|
||||||
]
|
]
|
||||||
|
|
||||||
def get_build_script_files(self):
|
def get_build_script_files(self):
|
||||||
|
|
||||||
"""Copying guix installation script on the image"""
|
"""Copying guix installation script on the image"""
|
||||||
return {
|
return {
|
||||||
"guix/guix-install.bash":
|
"guix/guix-install.bash": "/tmp/.local/bin/guix-install.bash",
|
||||||
"/tmp/.local/bin/guix-install.bash",
|
|
||||||
}
|
}
|
||||||
|
|
||||||
def get_assemble_scripts(self):
|
def get_assemble_scripts(self):
|
||||||
|
@ -54,7 +48,7 @@ class GuixBuildPack(BaseImage):
|
||||||
use guix time-machine if channels.scm file exists.
|
use guix time-machine if channels.scm file exists.
|
||||||
Finally set Guix environment variables.
|
Finally set Guix environment variables.
|
||||||
"""
|
"""
|
||||||
assemble_script ="""
|
assemble_script = """
|
||||||
/var/guix/profiles/per-user/root/current-guix/bin/guix-daemon \
|
/var/guix/profiles/per-user/root/current-guix/bin/guix-daemon \
|
||||||
--build-users-group=guixbuild --disable-chroot & \
|
--build-users-group=guixbuild --disable-chroot & \
|
||||||
su - $NB_USER -c '{}' && \
|
su - $NB_USER -c '{}' && \
|
||||||
|
@ -64,15 +58,18 @@ class GuixBuildPack(BaseImage):
|
||||||
|
|
||||||
if os.path.exists(self.binder_path("channels.scm")):
|
if os.path.exists(self.binder_path("channels.scm")):
|
||||||
assemble_script = assemble_script.format(
|
assemble_script = assemble_script.format(
|
||||||
"guix time-machine -C " + self.binder_path("channels.scm") +
|
"guix time-machine -C "
|
||||||
" -- package -m " + self.binder_path("manifest.scm")
|
+ self.binder_path("channels.scm")
|
||||||
|
+ " -- package -m "
|
||||||
|
+ self.binder_path("manifest.scm")
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
assemble_script = assemble_script.format(
|
assemble_script = assemble_script.format(
|
||||||
"guix package -m " + self.binder_path("manifest.scm")
|
"guix package -m " + self.binder_path("manifest.scm")
|
||||||
)
|
)
|
||||||
return super().get_assemble_scripts() + [
|
return super().get_assemble_scripts() + [
|
||||||
( "root",
|
(
|
||||||
|
"root",
|
||||||
assemble_script,
|
assemble_script,
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
@ -80,4 +77,3 @@ class GuixBuildPack(BaseImage):
|
||||||
def detect(self):
|
def detect(self):
|
||||||
"""Check if current repo should be built with the guix BuildPack"""
|
"""Check if current repo should be built with the guix BuildPack"""
|
||||||
return os.path.exists(self.binder_path("manifest.scm"))
|
return os.path.exists(self.binder_path("manifest.scm"))
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue