Skip to content

Commit f170875

Browse files
authored
Merge pull request #5778 from hpcng/master
Merge fixes from master for release 3.7.1
2 parents 9906d9f + 94c3fa4 commit f170875

File tree

29 files changed

+257
-98
lines changed

29 files changed

+257
-98
lines changed

CHANGELOG.md

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,21 @@ _With the release of `v3.0.0`, we're introducing a new changelog format in an at
99

1010
_The old changelog can be found in the `release-2.6` branch_
1111

12+
# Changes since v3.7.0
13+
14+
## Bug Fixes
15+
16+
- Accommodate /sys/fs/selinux mount changes on kernel 5.9+.
17+
- Fix loop devices file descriptor leak when shared loop devices is
18+
enabled.
19+
- Use MaxLoopDevices variable from config file in all appropriate
20+
locations.
21+
- Use -buildmode=default (non pie) on ppc64le to prevent crashes
22+
when using plugins.
23+
- Remove spurious warning in parseTokenSection()
24+
- e2e test fixes for new kernels, new unsquashfs version.
25+
26+
1227
# v3.7.0 - [2020-11-24]
1328

1429
## New features / functionalities
@@ -96,7 +111,7 @@ _The old changelog can be found in the `release-2.6` branch_
96111
- Increase embedded shell interpreter timeout, to allow slow-running
97112
environment scripts to complete.
98113
- Correct buffer handling for key import to allow import from STDIN.
99-
- Reset environment to avoid `LD_LIBRARYPATH` issues when resolving
114+
- Reset environment to avoid `LD_LIBRARY_PATH` issues when resolving
100115
dependencies for the `unsquashfs` sandbox.
101116
- Fall back to `/sbin/ldconfig` if `ldconfig` on `PATH` fails while
102117
resolving GPU libraries. Fixes problems on systems using Nix /
@@ -112,7 +127,7 @@ _The old changelog can be found in the `release-2.6` branch_
112127

113128
- A change in Linux kernel 5.9 causes `--fakeroot` builds to fail with a
114129
`/sys/fs/selinux` remount error. This will be addressed in Singularity
115-
v3.5.1.
130+
v3.7.1.
116131

117132

118133
# v3.6.4 - [2020-10-13]
@@ -162,6 +177,11 @@ Singularity 3.6.3 addresses the following security issues.
162177
enable arbitrary code execution during the build and/or when the
163178
built container is run.
164179

180+
## Change defaults / behaviours
181+
182+
- The value for maximum number of loop devices in the config file is now used everywhere
183+
instead of redefining this value
184+
165185
## Bug Fixes
166186

167187
- Add CAP_MKNOD in capability bounding set of RPC to fix issue with

CONTRIBUTORS.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
- Hakon Enger <[email protected]>
4242
- Hugo Meiland <[email protected]>
4343
44-
- Jack Morrison <[email protected]>
44+
4545
- Jacob Chappell <[email protected]>, <[email protected]>
4646
- Jarrod Johnson <[email protected]>
4747
@@ -82,9 +82,11 @@
8282
- Shengjing Zhu <[email protected]>
8383
- Tarcisio Fedrizzi <[email protected]>
8484
- Thomas Hamel <[email protected]>
85+
- Tim Wright <[email protected]>
8586
- Tru Huynh <[email protected]>
8687
- Vanessa Sochat <[email protected]>
8788
- Westley Kurtzer <[email protected]>, <[email protected]>
8889
8990
- Yaroslav Halchenko <[email protected]>
9091
- Onur Yılmaz <[email protected]>
92+
- Pranathi Locula <[email protected]>

cmd/internal/cli/build_linux.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import (
1313
"os"
1414
osExec "os/exec"
1515
"runtime"
16+
"strconv"
1617
"strings"
1718
"syscall"
1819

@@ -67,6 +68,12 @@ func fakerootExec(cmdArgs []string) {
6768
sylog.Fatalf("failed to retrieve user information: %s", err)
6869
}
6970

71+
// Append the user's real UID to the environment as _CONTAINERS_ROOTLESS_UID.
72+
// This is required in fakeroot builds that may use containers/image 5.7 and above.
73+
// https://github.com/containers/image/issues/1066
74+
// https://github.com/containers/image/blob/master/internal/rootless/rootless.go
75+
os.Setenv("_CONTAINERS_ROOTLESS_UID", strconv.Itoa(os.Getuid()))
76+
7077
engineConfig := &fakerootConfig.EngineConfig{
7178
Args: args,
7279
Envs: os.Environ(),

e2e/actions/actions.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ func (c actionTests) STDPipe(t *testing.T) {
474474

475475
// RunFromURI tests min fuctionality for singularity run/exec URI://
476476
func (c actionTests) RunFromURI(t *testing.T) {
477-
e2e.PrepRegistry(t, c.env)
477+
e2e.EnsureRegistry(t)
478478

479479
runScript := "testdata/runscript.sh"
480480
bind := fmt.Sprintf("%s:/.singularity.d/runscript", runScript)

e2e/docker/docker.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ func (c ctx) testDockerRegistry(t *testing.T) {
338338
defer cleanup(t)
339339
imagePath := filepath.Join(imageDir, "container")
340340

341-
e2e.PrepRegistry(t, c.env)
341+
e2e.EnsureRegistry(t)
342342

343343
tests := []struct {
344344
name string

e2e/imgbuild/imgbuild.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ func (c imgBuildTests) tempDir(t *testing.T, namespace string) (string, func())
4949
}
5050

5151
func (c imgBuildTests) buildFrom(t *testing.T) {
52-
e2e.PrepRegistry(t, c.env)
52+
e2e.EnsureRegistry(t)
5353

5454
// use a trailing slash in tests for sandbox intentionally to make sure
5555
// `singularity build -s /tmp/sand/ docker://alpine` works,

e2e/imgbuild/regressions.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ func (c *imgBuildTests) issue5166(t *testing.T) {
308308
}
309309

310310
func (c *imgBuildTests) issue5172(t *testing.T) {
311-
e2e.PrepRegistry(t, c.env)
311+
e2e.EnsureRegistry(t)
312312

313313
u := e2e.UserProfile.HostUser(t)
314314

e2e/inspect/inspect.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,16 @@ func (c ctx) singularityInspect(t *testing.T) {
7070

7171
require.Command(t, "unsquashfs")
7272

73-
cmd := exec.Command("unsquashfs", "-d", sandboxImage, squashImage)
73+
// First try with -user-xattrs since unsquashfs 4.4 gives an error code if
74+
// it can't set system xattrs while rootless.
75+
cmd := exec.Command("unsquashfs", "-user-xattrs", "-d", sandboxImage, squashImage)
7476
if res := cmd.Run(t); res.Error != nil {
75-
t.Fatalf("Unexpected error while running command.\n%s", res)
77+
// If we failed, then try without -user-xattrs for older unsquashfs
78+
// versions that don't have that flag.
79+
cmd := exec.Command("unsquashfs", "-d", sandboxImage, squashImage)
80+
if res := cmd.Run(t); res.Error != nil {
81+
t.Fatalf("Unexpected error while running command.\n%s", res)
82+
}
7683
}
7784

7885
compareLabel := func(label, out string, appName string) func(*testing.T, *inspect.Metadata) {

e2e/internal/e2e/docker.go

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,12 @@ var registrySetup struct {
2727
sync.Mutex
2828
}
2929

30-
// PrepRegistry run a docker registry and push a busybox
31-
// image and the test image with oras transport.
30+
// PrepRegistry runs a docker registry and pushes in a busybox image and
31+
// the test image using the oras transport.
32+
// This *MUST* be called before any tests using OCI/instances as it
33+
// temporarily mounts a shadow instance directory in the test user
34+
// $HOME that will obscure any instances of concurrent tests, causing
35+
// them to fail.
3236
func PrepRegistry(t *testing.T, env TestEnv) {
3337
// The docker registry container is only available for amd64 and arm
3438
// See: https://hub.docker.com/_/registry?tab=tags
@@ -40,6 +44,8 @@ func PrepRegistry(t *testing.T, env TestEnv) {
4044

4145
registrySetup.Do(func() {
4246

47+
t.Log("Preparing docker registry instance.")
48+
4349
EnsureImage(t, env)
4450

4551
dockerDefinition := "testdata/Docker_registry.def"
@@ -137,3 +143,15 @@ func KillRegistry(t *testing.T, env TestEnv) {
137143
ExpectExit(0),
138144
)
139145
}
146+
147+
// EnsureRegistry fails the current test if the e2e docker registry is not up
148+
func EnsureRegistry(t *testing.T) {
149+
// The docker registry container is only available for amd64 and arm
150+
// See: https://hub.docker.com/_/registry?tab=tags
151+
// Skip on other architectures
152+
require.ArchIn(t, []string{"amd64", "arm64"})
153+
154+
if registrySetup.up != 1 {
155+
t.Fatalf("Registry instance was not setup. e2e.PrepRegistry must be called before this test.")
156+
}
157+
}

e2e/pull/pull.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ func getImageNameFromURI(imgURI string) string {
253253

254254
func (c *ctx) setup(t *testing.T) {
255255
e2e.EnsureImage(t, c.env)
256-
e2e.PrepRegistry(t, c.env)
256+
e2e.EnsureRegistry(t)
257257

258258
// setup file and dir to use as invalid images
259259
orasInvalidDir, err := ioutil.TempDir(c.env.TestDir, "oras_push_dir-")

0 commit comments

Comments
 (0)