Skip to content

Commit ee8f485

Browse files
authored
Merge pull request #6160 from kmuriki/r3.8.2
R3.8.2
2 parents 47eebf7 + 64c29f0 commit ee8f485

File tree

33 files changed

+588
-172
lines changed

33 files changed

+588
-172
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ jobs:
8383
- name: Setup Go
8484
uses: actions/setup-go@v2
8585
with:
86-
go-version: 1.16.4
86+
go-version: 1.16.7
8787

8888
- name: Build Singularity
8989
run: |
@@ -126,7 +126,7 @@ jobs:
126126
- name: Setup Go
127127
uses: actions/setup-go@v2
128128
with:
129-
go-version: 1.16.4
129+
go-version: 1.16.7
130130

131131
- name: Fetch deps
132132
run: sudo apt-get install -y build-essential squashfs-tools libseccomp-dev cryptsetup
@@ -148,7 +148,7 @@ jobs:
148148
- name: Setup Go
149149
uses: actions/setup-go@v2
150150
with:
151-
go-version: 1.16.4
151+
go-version: 1.16.7
152152

153153
- name: Fetch deps
154154
run: sudo apt-get install -y build-essential squashfs-tools libseccomp-dev cryptsetup
@@ -192,7 +192,7 @@ jobs:
192192
if: env.run_tests
193193
uses: actions/setup-go@v2
194194
with:
195-
go-version: 1.16.4
195+
go-version: 1.16.7
196196

197197
- name: Fetch deps
198198
if: env.run_tests

CHANGELOG.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,29 @@
11
# Singularity Changelog
22

3+
## v3.8.2 - [2021-08-31]
4+
5+
### Bug fixes
6+
7+
- Fix regression when files `source`d from `%environment` contain `\` escaped
8+
shell builtins (fixes issue with `source` of conda profile.d script).
9+
- `singularity delete` will use the correct library service when the hostname
10+
is specified in the `library://` URI.
11+
- `singularity build` will use the correct library service when the hostname
12+
is specified in the `library://` URI / definition file.
13+
- Call `debootstrap` with correct Debian arch when it is not identical to the
14+
value of `runtime.GOARCH`. E.g. `ppc64el -> ppc64le`.
15+
- When destination is ommitted in `%files` entry in definition file, ensure
16+
globbed files are copied to correct resolved path.
17+
- Return an error if `--tokenfile` used for `remote login` to an OCI registry,
18+
as this is not supported.
19+
- Ensure repeated `remote login` to same URI does not create duplicate entries
20+
in `~/.singularity/remote.yaml`.
21+
- Properly escape single quotes in Docker `CMD` / `ENTRYPOINT` translation.
22+
- Use host uid when choosing unsquashfs flags, to avoid selinux xattr errors
23+
with `--fakeroot` on non-EL/Fedora distributions with recent squashfs-tools.
24+
- Updated the modified golang-x-crypto module with the latest upstream
25+
version.
26+
327
## v3.8.1 - [2021-08-12]
428

529
### Bug Fixes
@@ -13,6 +37,7 @@
1337
- Prevent garbage collection from closing the container image file
1438
descriptor.
1539
- Update to Arch Linux pacman.conf URL and remove file size verification.
40+
- Avoid panic when mountinfo line has a blank field.
1641

1742
## v3.8.0 - [2021-06-15]
1843

INSTALL.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ First, download the Golang archive to `/tmp`, then extract the archive to `/usr/
4040
_**NOTE:** if you are updating Go from a older version, make sure you remove `/usr/local/go` before
4141
reinstalling it._
4242

43-
```
44-
$ export VERSION=1.16.6 OS=linux ARCH=amd64 # change this as you need
43+
```sh
44+
$ export VERSION=1.16.7 OS=linux ARCH=amd64 # change this as you need
4545

4646
$ wget -O /tmp/go${VERSION}.${OS}-${ARCH}.tar.gz https://dl.google.com/go/go${VERSION}.${OS}-${ARCH}.tar.gz && \
4747
sudo tar -C /usr/local -xzf /tmp/go${VERSION}.${OS}-${ARCH}.tar.gz
@@ -87,7 +87,7 @@ $ mkdir -p ${GOPATH}/src/github.com/hpcng && \
8787
To build a stable version of Singularity, check out a [release tag](https://github.com/hpcng/singularity/tags) before compiling:
8888

8989
```
90-
$ git checkout v3.8.1
90+
$ git checkout v3.8.2
9191
```
9292

9393
## Compiling Singularity
@@ -130,7 +130,7 @@ as shown above. Then download the latest
130130
and use it to install the RPM like this:
131131

132132
```
133-
$ export VERSION=3.8.1 # this is the singularity version, change as you need
133+
$ export VERSION=3.8.2 # this is the singularity version, change as you need
134134
135135
$ wget https://github.com/hpcng/singularity/releases/download/v${VERSION}/singularity-${VERSION}.tar.gz && \
136136
rpmbuild -tb singularity-${VERSION}.tar.gz && \
@@ -146,7 +146,7 @@ tarball and use it to install Singularity:
146146
$ cd $GOPATH/src/github.com/hpcng/singularity && \
147147
./mconfig && \
148148
make -C builddir rpm && \
149-
sudo rpm -ivh ~/rpmbuild/RPMS/x86_64/singularity-3.8.1*.x86_64.rpm # or whatever version you built
149+
sudo rpm -ivh ~/rpmbuild/RPMS/x86_64/singularity-3.8.2*.x86_64.rpm # or whatever version you built
150150
```
151151

152152
To build an rpm with an alternative install prefix set RPMPREFIX on the

cmd/internal/cli/delete.go

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,18 @@ var deleteImageCmd = &cobra.Command{
9797
sylog.Fatalf("Error parsing library ref: %v", err)
9898
}
9999

100+
if deleteLibraryURI != "" && imageRef.Host != "" {
101+
sylog.Fatalf("Conflicting arguments; do not use --library with a library URI containing host name")
102+
}
103+
104+
var libraryURI string
105+
if deleteLibraryURI != "" {
106+
libraryURI = deleteLibraryURI
107+
} else if imageRef.Host != "" {
108+
// override libraryURI if ref contains host name
109+
libraryURI = "https://" + imageRef.Host
110+
}
111+
100112
r := fmt.Sprintf("%s:%s", imageRef.Path, imageRef.Tags[0])
101113

102114
if !deleteForce {
@@ -109,7 +121,7 @@ var deleteImageCmd = &cobra.Command{
109121
}
110122
}
111123

112-
libraryConfig, err := getLibraryClientConfig(deleteLibraryURI)
124+
libraryConfig, err := getLibraryClientConfig(libraryURI)
113125
if err != nil {
114126
sylog.Fatalf("Error while getting library client config: %v", err)
115127
}

cmd/internal/cli/remote.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ var remoteTokenFileFlag = cmdline.Flag{
6767
Value: &loginTokenFile,
6868
DefaultValue: "",
6969
Name: "tokenfile",
70-
Usage: "path to the file holding token",
70+
Usage: "path to the file holding auth token for login (remote endpoints only)",
7171
}
7272

7373
// --no-login
@@ -86,7 +86,7 @@ var remoteLoginUsernameFlag = cmdline.Flag{
8686
DefaultValue: "",
8787
Name: "username",
8888
ShortHand: "u",
89-
Usage: "username to authenticate with (leave it empty for token authentication)",
89+
Usage: "username to authenticate with (required for Docker/OCI registry login)",
9090
EnvKeys: []string{"LOGIN_USERNAME"},
9191
}
9292

@@ -97,7 +97,7 @@ var remoteLoginPasswordFlag = cmdline.Flag{
9797
DefaultValue: "",
9898
Name: "password",
9999
ShortHand: "p",
100-
Usage: "password to authenticate with",
100+
Usage: "password / token to authenticate with",
101101
EnvKeys: []string{"LOGIN_PASSWORD"},
102102
}
103103

docs/remote.go

Lines changed: 50 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,43 @@ const (
1414
RemoteUse string = `remote [remote options...]`
1515
RemoteShort string = `Manage singularity remote endpoints, keyservers and OCI/Docker registry credentials`
1616
RemoteLong string = `
17-
The 'remote' commands allow you to manage Singularity remote endpoints, keyservers
18-
and OCI/Docker registry credentials through its subcommands. The remote configuration
19-
is stored in $HOME/.singularity/remotes.yaml by default.`
17+
The 'remote' command allows you to manage Singularity remote endpoints,
18+
standalone keyservers and OCI/Docker registry credentials through its
19+
subcommands.
20+
21+
A 'remote endpoint' is the Sylabs Cloud, a Singularity Enterprise installation,
22+
or a compatible group of services. The remote endpoint is a single address,
23+
e.g. 'cloud.sylabs.io' through which linked library, builder and keystore
24+
sevices will be automatically discovered.
25+
26+
To configure a remote endpoint you must 'remote add' it. You can 'remote login' if
27+
you will be performing actions needing authentication. Switch between
28+
configured remote endpoints with the 'remote use' command. The active remote
29+
endpoint will be used for remote builds, key operations, and 'library://' pull
30+
and push. You can also 'remote logout' from and 'remote remove' an endpoint that
31+
is no longer required.
32+
33+
To configure credentials for OCI registries that should be used when pulling or
34+
pushing from/to 'docker://'' or 'oras://' URIs, use the 'remote login' command
35+
only. You do not have to 'remote add' OCI registries. To remove credentials
36+
'remote logout' with the same URI. You do not need to 'remote remove' OCI
37+
credentials.
38+
39+
The remote configuration is stored in $HOME/.singularity/remotes.yaml by default.`
2040
RemoteExample string = `
2141
All group commands have their own help output:
2242
23-
$ singularity help remote list
24-
$ singularity remote list`
43+
$ singularity help remote list
44+
$ singularity remote list`
2545
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2646
// remote add command
2747
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2848
RemoteAddUse string = `add [add options...] <remote_name> <remote_URI>`
29-
RemoteAddShort string = `Create a new singularity remote endpoint`
49+
RemoteAddShort string = `Add a new singularity remote endpoint`
3050
RemoteAddLong string = `
31-
The 'remote add' command allows you to create a new remote endpoint to be
32-
be used for singularity remote services. Authentication with a newly created
33-
endpoint will occur automatically.`
51+
The 'remote add' command allows you to add a new remote endpoint to be
52+
be used for singularity remote services. Authentication with a newly created
53+
endpoint will occur automatically.`
3454
RemoteAddExample string = `
3555
$ singularity remote add SylabsCloud cloud.sylabs.io`
3656
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -57,28 +77,39 @@ const (
5777
// remote list command
5878
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5979
RemoteListUse string = `list`
60-
RemoteListShort string = `List all singularity remote endpoints and services that are configured`
80+
RemoteListShort string = `List all singularity remote endpoints, keyservers, and OCI credentials that are configured`
6181
RemoteListLong string = `
62-
The 'remote list' command lists all remote endpoints configured for use. If a remote
63-
is in use, its name will be encompassed by brackets.`
82+
The 'remote list' command lists all remote endpoints, keyservers, and OCI registry
83+
credentials configured for use.
84+
85+
The current remote is indicated by 'YES' in the 'ACTIVE' column and can be changed
86+
with the 'remote use' command.`
6487
RemoteListExample string = `
6588
$ singularity remote list`
6689
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
6790
// remote login command
6891
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
6992
RemoteLoginUse string = `login [login options...] <remote_name|registry_uri>`
70-
RemoteLoginShort string = `Log into a singularity remote endpoint, an OCI/Docker registry or a keyserver using credentials`
93+
RemoteLoginShort string = `Login to a singularity remote endpoint, an OCI/Docker registry or a keyserver using credentials`
7194
RemoteLoginLong string = `
7295
The 'remote login' command allows you to set credentials for a specific endpoint,
73-
an OCI/Docker registry or a keyserver. This command can produce a link directing you to
74-
the token service you can use to generate a valid token. If no endpoint or registry is
75-
specified, it will try the default remote endpoint (SylabsCloud).`
96+
an OCI/Docker registry or a keyserver.
97+
98+
If no endpoint or registry is specified, the command will login to the currently
99+
active remote endpoint. This is cloud.sylabs.io by default.`
76100
RemoteLoginExample string = `
77101
To log in to an endpoint:
78102
$ singularity remote login SylabsCloud
79103
80104
To login in to a docker/OCI registry:
81-
$ singularity remote login --username foo --password bar docker://docker.io`
105+
$ singularity remote login --username foo docker://docker.io
106+
$ singularity remote login --username foo oras://myregistry.example.com
107+
108+
Note that many cloud OCI registries use token based authentication. The token
109+
should be specified as the password for login. A username is still required. E.g.
110+
when using a standard Azure identity and token to login to an ACR registry the
111+
username '00000000-0000-0000-0000-000000000000' is required. Consult your provider
112+
documentation for detail of their login requirements.`
82113
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
83114
// remote logout command
84115
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -87,7 +118,8 @@ const (
87118
RemoteLogoutLong string = `
88119
The 'remote logout' command allows you to log out from a singularity specific endpoint,
89120
an OCI/Docker registry or a keyserver. If no endpoint or service is specified, it will
90-
try the default remote endpoint (SylabsCloud).`
121+
logout from the current active remote endpoint.
122+
`
91123
RemoteLogoutExample string = `
92124
To log out from an endpoint
93125
$ singularity remote logout SylabsCloud

e2e/delete/delete.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ func (c ctx) testDeleteCmd(t *testing.T) {
2323
args []string
2424
agree string
2525
expectExit int
26+
expect e2e.SingularityCmdResultOp
2627
}{
2728
{
2829
name: "delete unauthorized arch",
@@ -66,6 +67,13 @@ func (c ctx) testDeleteCmd(t *testing.T) {
6667
agree: "y",
6768
expectExit: 255,
6869
},
70+
{
71+
name: "delete host in uri",
72+
args: []string{"library://library.example.com/test/default/test:v0.0.3"},
73+
agree: "y",
74+
expectExit: 255,
75+
expect: e2e.ExpectError(e2e.ContainMatch, "dial tcp: lookup library.example.com: no such host"),
76+
},
6977
}
7078

7179
for _, tt := range tests {
@@ -76,7 +84,7 @@ func (c ctx) testDeleteCmd(t *testing.T) {
7684
e2e.WithCommand("delete"),
7785
e2e.WithArgs(tt.args...),
7886
e2e.WithStdin(bytes.NewBufferString(tt.agree)),
79-
e2e.ExpectExit(tt.expectExit),
87+
e2e.ExpectExit(tt.expectExit, tt.expect),
8088
)
8189
}
8290
}

e2e/docker/docker.go

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2019, Sylabs Inc. All rights reserved.
1+
// Copyright (c) 2019-2021 Sylabs Inc. All rights reserved.
22
// This software is licensed under a 3-clause BSD license. Please consult the
33
// LICENSE.md file distributed with the sources of this project regarding your
44
// rights to use or distribute this software.
@@ -397,6 +397,19 @@ func (c ctx) testDockerRegistry(t *testing.T) {
397397
}
398398
}
399399

400+
// https://github.com/sylabs/singularity/issues/233
401+
func (c ctx) testDockerCMDQuotes(t *testing.T) {
402+
c.env.RunSingularity(
403+
t,
404+
e2e.WithProfile(e2e.UserProfile),
405+
e2e.WithCommand("run"),
406+
e2e.WithArgs("docker://sylabsio/issue233"),
407+
e2e.ExpectExit(0,
408+
e2e.ExpectOutput(e2e.ContainMatch, "Test run"),
409+
),
410+
)
411+
}
412+
400413
// E2ETests is the main func to trigger the test suite
401414
func E2ETests(env e2e.TestEnv) testhelper.Tests {
402415
c := ctx{
@@ -410,5 +423,6 @@ func E2ETests(env e2e.TestEnv) testhelper.Tests {
410423
"pulls": c.testDockerPulls,
411424
"registry": c.testDockerRegistry,
412425
"whiteout symlink": c.testDockerWhiteoutSymlink,
426+
"cmd quotes": c.testDockerCMDQuotes,
413427
}
414428
}

e2e/env/env.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -444,8 +444,9 @@ func E2ETests(env e2e.TestEnv) testhelper.Tests {
444444
"environment manipulation": c.singularityEnv,
445445
"environment option": c.singularityEnvOption,
446446
"environment file": c.singularityEnvFile,
447-
"issue 5057": c.issue5057, // https://github.com/sylabs/hpcng/issues/5057
448-
"issue 5426": c.issue5426, // https://github.com/sylabs/hpcng/issues/5426
447+
"issue 5057": c.issue5057, // https://github.com/hpcng/issues/5057
448+
"issue 5426": c.issue5426, // https://github.com/hpcng/issues/5426
449449
"issue 43": c.issue43, // https://github.com/sylabs/singularity/issues/43
450+
"issue 274": c.issue274, // https://github.com/sylabs/singularity/issues/274
450451
}
451452
}

0 commit comments

Comments
 (0)