Skip to content

Commit

Permalink
Merge pull request #401 from indigo-dc/devel3
Browse files Browse the repository at this point in the history
Devel3
  • Loading branch information
jorge-lip authored Oct 31, 2023
2 parents 92c6bb4 + 61f6c43 commit 6f8d6ae
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 17 deletions.
15 changes: 13 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Changelog

## udocker (1.3.11)

* add support for hard link to symbolic link conversion in Pn modes
as hard links cannot be created by unprivileged users - partially
addresses: #388
* check of availability of network extensions for port mapping and
netcoop in Pn modes and only use them if supported by the proot
engine being invoked.
* improve image metadata generated by udocker on import - closes: #398

## udocker (1.3.10)

* improved handling of container platform information
Expand All @@ -19,7 +29,8 @@
an architecture for the image
* new option `ps -p` enables list of the architectures of containers
* new option `images -p` enables list of the architectures of containers
* the udocker tools support for Fn now includes Ubuntu 23:04, Fedora 38,
* build udockertools 1.2.10 and set it as default
* the udockertools support for Fn now includes Ubuntu 23:04, Fedora 38,
Alpine 3.17 and 3.18.
* experimental support for native Fn execution on arm64 for Fedora 36,
Fedora 37, Fedora 38, CentOS 7, AlmaLinux 8, AlmaLinux 9 and Ubuntu 22,
Expand All @@ -32,7 +43,7 @@
## udocker (1.3.9)

* add support to access non-config metadata from containers
* added support for multiplatform manifests and indices solves #392
* added support for multiplatform manifests and indices solves #392 and #355

## udocker (1.3.8)

Expand Down
2 changes: 1 addition & 1 deletion codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"@type": "SoftwareSourceCode",
"identifier": "udocker",
"name": "udocker",
"version": "1.3.10",
"version": "1.3.11",
"description": "A basic user tool to execute simple docker containers in batch or interactive systems without root privileges",
"license": "Apache Software License 2.0, OSI Approved :: Apache Software License",
"author": [
Expand Down
18 changes: 9 additions & 9 deletions docs/installation_manual.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,18 @@ udocker requires:
Download a release tarball from <https://github.com/indigo-dc/udocker/releases>:

```bash
wget https://github.com/indigo-dc/udocker/releases/download/1.3.10/udocker-1.3.10.tar.gz
tar zxvf udocker-1.3.10.tar.gz
export PATH=`pwd`/udocker-1.3.10/udocker:$PATH
wget https://github.com/indigo-dc/udocker/releases/download/1.3.11/udocker-1.3.11.tar.gz
tar zxvf udocker-1.3.11.tar.gz
export PATH=`pwd`/udocker-1.3.11/udocker:$PATH
```

Alternatively use `curl` instead of `wget` as follows:

```bash
curl -L https://github.com/indigo-dc/udocker/releases/download/1.3.10/udocker-1.3.10.tar.gz \
> udocker-1.3.10.tar.gz
tar zxvf udocker-1.3.10.tar.gz
export PATH=`pwd`/udocker-1.3.10/udocker:$PATH
curl -L https://github.com/indigo-dc/udocker/releases/download/1.3.11/udocker-1.3.11.tar.gz \
> udocker-1.3.11.tar.gz
tar zxvf udocker-1.3.11.tar.gz
export PATH=`pwd`/udocker-1.3.11/udocker:$PATH
```

udocker executes containers using external tools and libraries that
Expand Down Expand Up @@ -353,8 +353,8 @@ The udocker tool should be installed as shown in section 2.1:

```bash
cd /sw
wget https://github.com/indigo-dc/udocker/releases/download/1.3.10/udocker-1.3.10.tar.gz
tar zxvf udocker-1.3.10.tar.gz
wget https://github.com/indigo-dc/udocker/releases/download/1.3.11/udocker-1.3.11.tar.gz
tar zxvf udocker-1.3.11.tar.gz
```

Directing users to the central udocker installation can be done using the
Expand Down
2 changes: 1 addition & 1 deletion docs/udocker.1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.\" Manpage for udocker
.\" Contact [email protected] to correct errors or typos.
.\" To read this man page use: man -l udocker.1
.TH udocker 1 "30 Jun 2023" "version 1.3.10" "udocker man page"
.TH udocker 1 "31 Oct 2023" "version 1.3.11" "udocker man page"
.SH NAME
udocker \- execute Docker containers in user space without privileges
.SH SYNOPSIS
Expand Down
2 changes: 1 addition & 1 deletion udocker/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
"Singularity http://singularity.lbl.gov"
]
__license__ = "Licensed under the Apache License, Version 2.0"
__version__ = "1.3.10"
__version__ = "1.3.11"
__date__ = "2023"
6 changes: 6 additions & 0 deletions udocker/commonlocalfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from udocker.engine.execmode import ExecutionMode
from udocker.utils.fileutil import FileUtil
from udocker.utils.uprocess import Uprocess
from udocker.utils.chksum import ChkSUM


class CommonLocalFileApi(object):
Expand Down Expand Up @@ -100,6 +101,11 @@ def create_container_meta(self, layer_id, platform=""):
container_json["size"] = FileUtil(layer_file).size()
if container_json["size"] == -1:
container_json["size"] = 0
layer_chksum = ChkSUM().hash(layer_file, "sha256")
if layer_chksum:
container_json["rootfs"] = {}
container_json["rootfs"]["type"] = "layers"
container_json["rootfs"]["diff_ids"] = [ "sha256:" + layer_chksum, ]
container_json["container_config"] = {
"Hostname": "",
"Domainname": "",
Expand Down
3 changes: 2 additions & 1 deletion udocker/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ class Config(object):
# PRoot override seccomp
# conf['proot_noseccomp'] = True
conf['proot_noseccomp'] = None
conf['proot_killonexit'] = True # PRoot kill-on-exit
conf['proot_killonexit'] = True # PRoot --kill-on-exit
conf['proot_link2symlink'] = True # PRoot --link2symlink

# fakechroot engine get ld_library_paths from ld.so.cache
conf['ld_so_cache'] = "/etc/ld.so.cache"
Expand Down
13 changes: 11 additions & 2 deletions udocker/engine/proot.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,11 @@ def _get_network_map(self):
proot_netmap_list = []
for (cont_port, host_port) in list(self._get_portsmap().items()):
proot_netmap_list.extend(["-p", "%d:%d" % (cont_port, host_port)])
if self.opt["netcoop"]:
if self.opt["netcoop"] and self._has_option("--netcoop"):
proot_netmap_list.extend(["-n", ])
return proot_netmap_list
if proot_netmap_list and self._has_option("--port"):
return proot_netmap_list
return []

def _get_qemu_string(self):
"""Get the qemu string for container run command if emulation needed"""
Expand Down Expand Up @@ -162,6 +164,12 @@ def run(self, container_id):
else:
proot_verbose = []

if (Config.conf['proot_link2symlink'] and
self._has_option("--link2symlink")):
proot_link2symlink = ["--link2symlink", ]
else:
proot_link2symlink = []

if (Config.conf['proot_killonexit'] and
self._has_option("--kill-on-exit")):
proot_kill_on_exit = ["--kill-on-exit", ]
Expand All @@ -173,6 +181,7 @@ def run(self, container_id):
cmd_l.append(self.executable)
cmd_l.extend(proot_verbose)
cmd_l.extend(proot_kill_on_exit)
cmd_l.extend(proot_link2symlink)
cmd_l.extend(self._get_qemu_string())
cmd_l.extend(self._get_volume_bindings())
cmd_l.extend(self._set_uid_map())
Expand Down

0 comments on commit 6f8d6ae

Please sign in to comment.