Skip to content

Commit 47619cc

Browse files
author
github-actions
committed
Merge branch 'main' into cras
2 parents 3df60fa + de0ed19 commit 47619cc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+624
-283
lines changed

.circleci/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ orbs:
66
parameters:
77
go-version:
88
type: string
9-
default: '1.23.5'
9+
default: '1.24.0'
1010

1111
executors:
1212
node:
@@ -41,7 +41,7 @@ executors:
4141
- image: ubuntu:24.04
4242
golangci-lint:
4343
docker:
44-
- image: golangci/golangci-lint:v1.60.1
44+
- image: golangci/golangci-lint:v1.64
4545
ubuntu-machine:
4646
machine:
4747
image: ubuntu-2404:2024.05.1

.golangci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ linters:
2020
- bodyclose
2121
- containedctx
2222
- contextcheck
23+
- copyloopvar
2324
- decorder
2425
- dogsled
2526
- dupl
2627
- dupword
27-
- exportloopref
2828
- forcetypeassert
2929
- gofumpt
3030
- goimports
@@ -55,7 +55,7 @@ linters-settings:
5555
locale: US
5656

5757
issues:
58-
max-per-linter: 0
58+
max-issues-per-linter: 0
5959
max-same-issues: 0
6060
exclude:
6161
# EXC0004 excluded due to spurious "should have signature XYZ" errors on

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949

5050
## Requirements / Packaging
5151

52+
- Go 1.23.4 or above is now required to build SingularityCE.
5253
- libsubid headers are now required to build SingularityCE, unless the
5354
`--without-libsubid` flag is passed to `mconfig`.
5455
- EL RPM packages are built with libsubid support.

INSTALL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ _**NOTE:** if you are updating Go from a older version, make sure you remove
130130
`/usr/local/go` before reinstalling it._
131131

132132
```sh
133-
export VERSION=1.23.5 OS=linux ARCH=amd64 # change this as you need
133+
export VERSION=1.24.0 OS=linux ARCH=amd64 # change this as you need
134134

135135
wget -O /tmp/go${VERSION}.${OS}-${ARCH}.tar.gz \
136136
https://dl.google.com/go/go${VERSION}.${OS}-${ARCH}.tar.gz

LICENSE_DEPENDENCIES.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1040,6 +1040,36 @@ SOFTWARE.
10401040
```
10411041

10421042

1043+
## github.com/ccoveille/go-safecast
1044+
1045+
**License:** MIT
1046+
1047+
```
1048+
MIT License
1049+
1050+
Copyright (c) 2024 ccoVeille
1051+
1052+
Permission is hereby granted, free of charge, to any person obtaining a copy
1053+
of this software and associated documentation files (the "Software"), to deal
1054+
in the Software without restriction, including without limitation the rights
1055+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1056+
copies of the Software, and to permit persons to whom the Software is
1057+
furnished to do so, subject to the following conditions:
1058+
1059+
The above copyright notice and this permission notice shall be included in all
1060+
copies or substantial portions of the Software.
1061+
1062+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1063+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1064+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1065+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1066+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1067+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1068+
SOFTWARE.
1069+
1070+
```
1071+
1072+
10431073
## github.com/cenkalti/backoff/v4
10441074

10451075
**License:** MIT

cmd/internal/cli/build_linux.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Copyright (c) 2020, Control Command Inc. All rights reserved.
2-
// Copyright (c) 2018-2023, Sylabs Inc. All rights reserved.
2+
// Copyright (c) 2018-2025, Sylabs Inc. All rights reserved.
33
// Copyright (c) Contributors to the Apptainer project, established as
44
// Apptainer a Series of LF Projects LLC.
55
// This software is licensed under a 3-clause BSD license. Please consult the
@@ -18,6 +18,7 @@ import (
1818
"strings"
1919
"syscall"
2020

21+
"github.com/ccoveille/go-safecast"
2122
"github.com/google/go-containerregistry/pkg/authn"
2223
"github.com/spf13/cobra"
2324
keyclient "github.com/sylabs/scs-key-client/client"
@@ -74,7 +75,11 @@ func fakerootExec() {
7475
}
7576
}
7677

77-
user, err := user.GetPwUID(uint32(os.Getuid()))
78+
uid, err := safecast.ToUint32(os.Getuid())
79+
if err != nil {
80+
sylog.Fatalf("while getting uid: %v", err)
81+
}
82+
user, err := user.GetPwUID(uid)
7883
if err != nil {
7984
sylog.Fatalf("failed to retrieve user information: %s", err)
8085
}

cmd/internal/cli/cgroups.go

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2022, Sylabs Inc. All rights reserved.
1+
// Copyright (c) 2022-2025, 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.
@@ -12,6 +12,7 @@ import (
1212
"strings"
1313
"time"
1414

15+
"github.com/ccoveille/go-safecast"
1516
"github.com/docker/go-units"
1617
"github.com/shopspring/decimal"
1718
"github.com/sylabs/singularity/v4/internal/pkg/cgroups"
@@ -198,9 +199,14 @@ func getCPULimits() (*cgroups.LinuxCPU, error) {
198199
return nil, fmt.Errorf("cpus value must be in range %s - %s", minCPU.String(), maxCPU.String())
199200
}
200201

201-
nanoCPUs := dCpus.Mul(decimal.NewFromInt(1e9)).IntPart()
202-
203-
quota := nanoCPUs * int64(period) / 1e9
202+
nanoCPUs, err := safecast.ToUint64(dCpus.Mul(decimal.NewFromInt(1e9)).IntPart())
203+
if err != nil {
204+
return nil, err
205+
}
206+
quota, err := safecast.ToInt64(nanoCPUs * period / 1e9)
207+
if err != nil {
208+
return nil, err
209+
}
204210
cpu.Period = &period
205211
cpu.Quota = &quota
206212
configured = true

cmd/internal/cli/keyserver.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2019-2023, Sylabs Inc. All rights reserved.
1+
// Copyright (c) 2019-2025, Sylabs Inc. All rights reserved.
22
// Copyright (c) 2020, Control Command Inc. All rights reserved.
33
// This software is licensed under a 3-clause BSD license. Please consult the
44
// LICENSE.md file distributed with the sources of this project regarding your
@@ -170,7 +170,7 @@ var KeyserverRemoveCmd = &cobra.Command{
170170
}
171171

172172
func setKeyserver(_ *cobra.Command, _ []string) {
173-
if uint32(os.Getuid()) != 0 {
173+
if os.Getuid() != 0 {
174174
sylog.Fatalf("Unable to modify keyserver configuration: not root user")
175175
}
176176
}

cmd/internal/cli/remote.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2019-2023, Sylabs Inc. All rights reserved.
1+
// Copyright (c) 2019-2025, Sylabs Inc. All rights reserved.
22
// Copyright (c) 2020, Control Command Inc. All rights reserved.
33
// This software is licensed under a 3-clause BSD license. Please consult the
44
// LICENSE.md file distributed with the sources of this project regarding your
@@ -203,8 +203,7 @@ func setGlobalRemoteConfig(_ *cobra.Command, _ []string) {
203203
return
204204
}
205205

206-
uid := uint32(os.Getuid())
207-
if uid != 0 {
206+
if os.Getuid() != 0 {
208207
sylog.Fatalf("Unable to modify global endpoint configuration file: not root user")
209208
}
210209

docs/remote.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2019-2024, Sylabs Inc. All rights reserved.
1+
// Copyright (c) 2019-2025, Sylabs Inc. All rights reserved.
22
// Copyright (c) 2020, Control Command Inc. All rights reserved.
33
// This software is licensed under a 3-clause BSD license. Please consult the
44
// LICENSE.md file distributed with the sources of this project regarding your
@@ -40,10 +40,10 @@ const (
4040
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4141
// remote get-login-password
4242
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
43-
RemoteGetLoginPasswordUse string = `get-login-password` //nolint:gosec
43+
RemoteGetLoginPasswordUse string = `get-login-password`
4444
RemoteGetLoginPasswordShort string = `Retrieves the cli secret for the currently logged in user`
4545
RemoteGetLoginPasswordLong string = `The 'remote get-login-password' command allows you to retrieve the cli secret for the currently user.`
46-
RemoteGetLoginPasswordExample string = `$ singularity remote get-login-password | docker login -u user --password-stdin https://harbor.sylabs.io` //nolint:gosec
46+
RemoteGetLoginPasswordExample string = `$ singularity remote get-login-password | docker login -u user --password-stdin https://harbor.sylabs.io`
4747
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4848
// remote add command
4949
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

0 commit comments

Comments
 (0)