Skip to content

Commit c05335f

Browse files
authored
Merge pull request #3599 from dtrudg/pick-3597
deps: switch to oc/cgroups (release-4.3)
2 parents 0366383 + 814b70f commit c05335f

File tree

13 files changed

+248
-35
lines changed

13 files changed

+248
-35
lines changed

CONTRIBUTORS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ The following have contributed code and/or documentation to this repository.
6868
- Josef Hrabal <josef.hrabal@vsb.cz>
6969
- Justin Cook <justin@sylabs.io>
7070
- Justin Riley <justin_riley@harvard.edu>
71+
- Kir Kolyshkin <kolyshkin@gmail.com>
7172
- Krishna Muriki <kmuriki@lbl.gov>
7273
- Kumar Sukhani <kumarsukhani@gmail.com>
7374
- Kundan Kumar <iamkundankumar28@gmail.com>

LICENSE_DEPENDENCIES.md

Lines changed: 211 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17683,6 +17683,216 @@ Apache License
1768317683
```
1768417684

1768517685

17686+
## github.com/opencontainers/cgroups
17687+
17688+
**License:** Apache-2.0
17689+
17690+
```
17691+
Apache License
17692+
Version 2.0, January 2004
17693+
http://www.apache.org/licenses/
17694+
17695+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
17696+
17697+
1. Definitions.
17698+
17699+
"License" shall mean the terms and conditions for use, reproduction,
17700+
and distribution as defined by Sections 1 through 9 of this document.
17701+
17702+
"Licensor" shall mean the copyright owner or entity authorized by
17703+
the copyright owner that is granting the License.
17704+
17705+
"Legal Entity" shall mean the union of the acting entity and all
17706+
other entities that control, are controlled by, or are under common
17707+
control with that entity. For the purposes of this definition,
17708+
"control" means (i) the power, direct or indirect, to cause the
17709+
direction or management of such entity, whether by contract or
17710+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
17711+
outstanding shares, or (iii) beneficial ownership of such entity.
17712+
17713+
"You" (or "Your") shall mean an individual or Legal Entity
17714+
exercising permissions granted by this License.
17715+
17716+
"Source" form shall mean the preferred form for making modifications,
17717+
including but not limited to software source code, documentation
17718+
source, and configuration files.
17719+
17720+
"Object" form shall mean any form resulting from mechanical
17721+
transformation or translation of a Source form, including but
17722+
not limited to compiled object code, generated documentation,
17723+
and conversions to other media types.
17724+
17725+
"Work" shall mean the work of authorship, whether in Source or
17726+
Object form, made available under the License, as indicated by a
17727+
copyright notice that is included in or attached to the work
17728+
(an example is provided in the Appendix below).
17729+
17730+
"Derivative Works" shall mean any work, whether in Source or Object
17731+
form, that is based on (or derived from) the Work and for which the
17732+
editorial revisions, annotations, elaborations, or other modifications
17733+
represent, as a whole, an original work of authorship. For the purposes
17734+
of this License, Derivative Works shall not include works that remain
17735+
separable from, or merely link (or bind by name) to the interfaces of,
17736+
the Work and Derivative Works thereof.
17737+
17738+
"Contribution" shall mean any work of authorship, including
17739+
the original version of the Work and any modifications or additions
17740+
to that Work or Derivative Works thereof, that is intentionally
17741+
submitted to Licensor for inclusion in the Work by the copyright owner
17742+
or by an individual or Legal Entity authorized to submit on behalf of
17743+
the copyright owner. For the purposes of this definition, "submitted"
17744+
means any form of electronic, verbal, or written communication sent
17745+
to the Licensor or its representatives, including but not limited to
17746+
communication on electronic mailing lists, source code control systems,
17747+
and issue tracking systems that are managed by, or on behalf of, the
17748+
Licensor for the purpose of discussing and improving the Work, but
17749+
excluding communication that is conspicuously marked or otherwise
17750+
designated in writing by the copyright owner as "Not a Contribution."
17751+
17752+
"Contributor" shall mean Licensor and any individual or Legal Entity
17753+
on behalf of whom a Contribution has been received by Licensor and
17754+
subsequently incorporated within the Work.
17755+
17756+
2. Grant of Copyright License. Subject to the terms and conditions of
17757+
this License, each Contributor hereby grants to You a perpetual,
17758+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
17759+
copyright license to reproduce, prepare Derivative Works of,
17760+
publicly display, publicly perform, sublicense, and distribute the
17761+
Work and such Derivative Works in Source or Object form.
17762+
17763+
3. Grant of Patent License. Subject to the terms and conditions of
17764+
this License, each Contributor hereby grants to You a perpetual,
17765+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
17766+
(except as stated in this section) patent license to make, have made,
17767+
use, offer to sell, sell, import, and otherwise transfer the Work,
17768+
where such license applies only to those patent claims licensable
17769+
by such Contributor that are necessarily infringed by their
17770+
Contribution(s) alone or by combination of their Contribution(s)
17771+
with the Work to which such Contribution(s) was submitted. If You
17772+
institute patent litigation against any entity (including a
17773+
cross-claim or counterclaim in a lawsuit) alleging that the Work
17774+
or a Contribution incorporated within the Work constitutes direct
17775+
or contributory patent infringement, then any patent licenses
17776+
granted to You under this License for that Work shall terminate
17777+
as of the date such litigation is filed.
17778+
17779+
4. Redistribution. You may reproduce and distribute copies of the
17780+
Work or Derivative Works thereof in any medium, with or without
17781+
modifications, and in Source or Object form, provided that You
17782+
meet the following conditions:
17783+
17784+
(a) You must give any other recipients of the Work or
17785+
Derivative Works a copy of this License; and
17786+
17787+
(b) You must cause any modified files to carry prominent notices
17788+
stating that You changed the files; and
17789+
17790+
(c) You must retain, in the Source form of any Derivative Works
17791+
that You distribute, all copyright, patent, trademark, and
17792+
attribution notices from the Source form of the Work,
17793+
excluding those notices that do not pertain to any part of
17794+
the Derivative Works; and
17795+
17796+
(d) If the Work includes a "NOTICE" text file as part of its
17797+
distribution, then any Derivative Works that You distribute must
17798+
include a readable copy of the attribution notices contained
17799+
within such NOTICE file, excluding those notices that do not
17800+
pertain to any part of the Derivative Works, in at least one
17801+
of the following places: within a NOTICE text file distributed
17802+
as part of the Derivative Works; within the Source form or
17803+
documentation, if provided along with the Derivative Works; or,
17804+
within a display generated by the Derivative Works, if and
17805+
wherever such third-party notices normally appear. The contents
17806+
of the NOTICE file are for informational purposes only and
17807+
do not modify the License. You may add Your own attribution
17808+
notices within Derivative Works that You distribute, alongside
17809+
or as an addendum to the NOTICE text from the Work, provided
17810+
that such additional attribution notices cannot be construed
17811+
as modifying the License.
17812+
17813+
You may add Your own copyright statement to Your modifications and
17814+
may provide additional or different license terms and conditions
17815+
for use, reproduction, or distribution of Your modifications, or
17816+
for any such Derivative Works as a whole, provided Your use,
17817+
reproduction, and distribution of the Work otherwise complies with
17818+
the conditions stated in this License.
17819+
17820+
5. Submission of Contributions. Unless You explicitly state otherwise,
17821+
any Contribution intentionally submitted for inclusion in the Work
17822+
by You to the Licensor shall be under the terms and conditions of
17823+
this License, without any additional terms or conditions.
17824+
Notwithstanding the above, nothing herein shall supersede or modify
17825+
the terms of any separate license agreement you may have executed
17826+
with Licensor regarding such Contributions.
17827+
17828+
6. Trademarks. This License does not grant permission to use the trade
17829+
names, trademarks, service marks, or product names of the Licensor,
17830+
except as required for reasonable and customary use in describing the
17831+
origin of the Work and reproducing the content of the NOTICE file.
17832+
17833+
7. Disclaimer of Warranty. Unless required by applicable law or
17834+
agreed to in writing, Licensor provides the Work (and each
17835+
Contributor provides its Contributions) on an "AS IS" BASIS,
17836+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
17837+
implied, including, without limitation, any warranties or conditions
17838+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
17839+
PARTICULAR PURPOSE. You are solely responsible for determining the
17840+
appropriateness of using or redistributing the Work and assume any
17841+
risks associated with Your exercise of permissions under this License.
17842+
17843+
8. Limitation of Liability. In no event and under no legal theory,
17844+
whether in tort (including negligence), contract, or otherwise,
17845+
unless required by applicable law (such as deliberate and grossly
17846+
negligent acts) or agreed to in writing, shall any Contributor be
17847+
liable to You for damages, including any direct, indirect, special,
17848+
incidental, or consequential damages of any character arising as a
17849+
result of this License or out of the use or inability to use the
17850+
Work (including but not limited to damages for loss of goodwill,
17851+
work stoppage, computer failure or malfunction, or any and all
17852+
other commercial damages or losses), even if such Contributor
17853+
has been advised of the possibility of such damages.
17854+
17855+
9. Accepting Warranty or Additional Liability. While redistributing
17856+
the Work or Derivative Works thereof, You may choose to offer,
17857+
and charge a fee for, acceptance of support, warranty, indemnity,
17858+
or other liability obligations and/or rights consistent with this
17859+
License. However, in accepting such obligations, You may act only
17860+
on Your own behalf and on Your sole responsibility, not on behalf
17861+
of any other Contributor, and only if You agree to indemnify,
17862+
defend, and hold each Contributor harmless for any liability
17863+
incurred by, or claims asserted against, such Contributor by reason
17864+
of your accepting any such warranty or additional liability.
17865+
17866+
END OF TERMS AND CONDITIONS
17867+
17868+
APPENDIX: How to apply the Apache License to your work.
17869+
17870+
To apply the Apache License to your work, attach the following
17871+
boilerplate notice, with the fields enclosed by brackets "{}"
17872+
replaced with your own identifying information. (Don't include
17873+
the brackets!) The text should be enclosed in the appropriate
17874+
comment syntax for the file format. We also recommend that a
17875+
file or class name and description of purpose be included on the
17876+
same "printed page" as the copyright notice for easier
17877+
identification within third-party archives.
17878+
17879+
Copyright {yyyy} {name of copyright owner}
17880+
17881+
Licensed under the Apache License, Version 2.0 (the "License");
17882+
you may not use this file except in compliance with the License.
17883+
You may obtain a copy of the License at
17884+
17885+
http://www.apache.org/licenses/LICENSE-2.0
17886+
17887+
Unless required by applicable law or agreed to in writing, software
17888+
distributed under the License is distributed on an "AS IS" BASIS,
17889+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17890+
See the License for the specific language governing permissions and
17891+
limitations under the License.
17892+
17893+
```
17894+
17895+
1768617896
## github.com/opencontainers/go-digest
1768717897

1768817898
**License:** Apache-2.0
@@ -30110,7 +30320,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3011030320
```
3011130321

3011230322

30113-
## golang.org/x/exp
30323+
## golang.org/x/exp/slices
3011430324

3011530325
**License:** BSD-3-Clause
3011630326

e2e/cgroups/cgroups.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
"testing"
1111

1212
"github.com/google/uuid"
13-
"github.com/opencontainers/runc/libcontainer/cgroups"
13+
"github.com/opencontainers/cgroups"
1414
"github.com/sylabs/singularity/v4/e2e/internal/e2e"
1515
"github.com/sylabs/singularity/v4/e2e/internal/testhelper"
1616
"github.com/sylabs/singularity/v4/internal/pkg/test/tool/require"

go.mod

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,9 @@ require (
3535
github.com/moby/sys/sequential v0.6.0
3636
github.com/moby/sys/userns v0.1.0
3737
github.com/moby/term v0.5.2
38+
github.com/opencontainers/cgroups v0.0.1
3839
github.com/opencontainers/image-spec v1.1.1
39-
github.com/opencontainers/runc v1.2.5
40+
github.com/opencontainers/runc v1.3.0-rc.1
4041
github.com/opencontainers/runtime-spec v1.2.1
4142
github.com/opencontainers/runtime-tools v0.9.1-0.20230914150019-408c51e934dc
4243
github.com/opencontainers/selinux v1.11.1
@@ -92,7 +93,7 @@ require (
9293
github.com/blang/semver v3.5.1+incompatible // indirect
9394
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
9495
github.com/cespare/xxhash/v2 v2.3.0 // indirect
95-
github.com/cilium/ebpf v0.16.0 // indirect
96+
github.com/cilium/ebpf v0.17.3 // indirect
9697
github.com/cloudflare/circl v1.3.7 // indirect
9798
github.com/containerd/cgroups/v3 v3.0.5 // indirect
9899
github.com/containerd/console v1.0.4 // indirect

go.sum

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,8 @@ github.com/chrismellard/docker-credential-acr-env v0.0.0-20230304212654-82a0ddb2
199199
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
200200
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
201201
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
202-
github.com/cilium/ebpf v0.16.0 h1:+BiEnHL6Z7lXnlGUsXQPPAE7+kenAd4ES8MQ5min0Ok=
203-
github.com/cilium/ebpf v0.16.0/go.mod h1:L7u2Blt2jMM/vLAVgjxluxtBKlz3/GWjB0dMOEngfwE=
202+
github.com/cilium/ebpf v0.17.3 h1:FnP4r16PWYSE4ux6zN+//jMcW4nMVRvuTLVTvCjyyjg=
203+
github.com/cilium/ebpf v0.17.3/go.mod h1:G5EDHij8yiLzaqn0WjyfJHvRa+3aDlReIaLVRMvOyJk=
204204
github.com/clbanning/mxj/v2 v2.7.0 h1:WA/La7UGCanFe5NpHF0Q3DNtnCsVoxbPKuyBNHWRyME=
205205
github.com/clbanning/mxj/v2 v2.7.0/go.mod h1:hNiWqW14h+kc+MdF9C6/YoRfjEJoR3ou6tn/Qo+ve2s=
206206
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
@@ -686,14 +686,16 @@ github.com/onsi/gomega v1.36.0 h1:Pb12RlruUtj4XUuPUqeEWc6j5DkVVVA49Uf6YLfC95Y=
686686
github.com/onsi/gomega v1.36.0/go.mod h1:PvZbdDc8J6XJEpDK4HCuRBm8a6Fzp9/DmhC9C7yFlog=
687687
github.com/open-policy-agent/opa v1.1.0 h1:HMz2evdEMTyNqtdLjmu3Vyx06BmhNYAx67Yz3Ll9q2s=
688688
github.com/open-policy-agent/opa v1.1.0/go.mod h1:T1pASQ1/vwfTa+e2fYcfpLCvWgYtqtiUv+IuA/dLPQs=
689+
github.com/opencontainers/cgroups v0.0.1 h1:MXjMkkFpKv6kpuirUa4USFBas573sSAY082B4CiHEVA=
690+
github.com/opencontainers/cgroups v0.0.1/go.mod h1:s8lktyhlGUqM7OSRL5P7eAW6Wb+kWPNvt4qvVfzA5vs=
689691
github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U=
690692
github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM=
691693
github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0=
692694
github.com/opencontainers/image-spec v1.1.1 h1:y0fUlFfIZhPF1W537XOLg0/fcx6zcHCJwooC2xJA040=
693695
github.com/opencontainers/image-spec v1.1.1/go.mod h1:qpqAh3Dmcf36wStyyWU+kCeDgrGnAve2nCC8+7h8Q0M=
694696
github.com/opencontainers/runc v1.0.0-rc90/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U=
695-
github.com/opencontainers/runc v1.2.5 h1:8KAkq3Wrem8bApgOHyhRI/8IeLXIfmZ6Qaw6DNSLnA4=
696-
github.com/opencontainers/runc v1.2.5/go.mod h1:dOQeFo29xZKBNeRBI0B19mJtfHv68YgCTh1X+YphA+4=
697+
github.com/opencontainers/runc v1.3.0-rc.1 h1:KfTjaxzza5ON6lJpZuQsxtcofRm5Ln/rz3CLJfqKUJ8=
698+
github.com/opencontainers/runc v1.3.0-rc.1/go.mod h1:fcCrKzduSlcozkBPJ0oyrsEpARFitn97yX+pvlktT54=
697699
github.com/opencontainers/runtime-spec v1.0.2/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0=
698700
github.com/opencontainers/runtime-spec v1.2.1 h1:S4k4ryNgEpxW1dzyqffOmhI1BHYcjzU8lpJfSlR0xww=
699701
github.com/opencontainers/runtime-spec v1.2.1/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0=

internal/app/singularity/instance_linux.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import (
2525
"github.com/buger/goterm"
2626
"github.com/ccoveille/go-safecast"
2727
units "github.com/docker/go-units"
28-
libcgroups "github.com/opencontainers/runc/libcontainer/cgroups"
28+
libcgroups "github.com/opencontainers/cgroups"
2929
"github.com/sylabs/singularity/v4/internal/pkg/cgroups"
3030
"github.com/sylabs/singularity/v4/internal/pkg/instance"
3131
"github.com/sylabs/singularity/v4/pkg/sylog"
@@ -276,7 +276,7 @@ func InstanceStats(ctx context.Context, name, instanceUser string, formatJSON bo
276276
}
277277

278278
// Stats can be added from this set
279-
// https://github.com/opencontainers/runc/blob/main/libcontainer/cgroups/stats.go
279+
// https://github.com/opencontainers/cgroups/blob/main/stats.go
280280
_, err = fmt.Fprintln(tabWriter, "INSTANCE NAME\tCPU USAGE\tMEM USAGE / LIMIT\tMEM %\tBLOCK I/O\tPIDS")
281281
if err != nil {
282282
return fmt.Errorf("could not write stats header: %v", err)

internal/app/singularity/oci_linux.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212
"context"
1313
"fmt"
1414

15-
lccgroups "github.com/opencontainers/runc/libcontainer/cgroups"
15+
lccgroups "github.com/opencontainers/cgroups"
1616
"github.com/sylabs/singularity/v4/internal/pkg/buildcfg"
1717
"github.com/sylabs/singularity/v4/internal/pkg/runtime/launcher/oci"
1818
ocibundle "github.com/sylabs/singularity/v4/pkg/ocibundle/sif"

0 commit comments

Comments
 (0)