FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Test new cg2 branch of isolate with Ubuntu 22.04 · cms-dev/cms@619a895 · GitHub

/ cms Public

Commit 619a895

Browse files
committed
Test new cg2 branch of isolate with Ubuntu 22.04
1 parent f0d969b commit 619a895

6 files changed

Lines changed: 31 additions & 9 deletions

File tree

‎.github/workflows/main.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66

77
jobs:
88
test:
9-
runs-on: ubuntu-20.04
9+
runs-on: ubuntu-24.04
1010

1111
steps:
1212
- uses: actions/checkout@v2

‎Dockerfile‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
# syntax=docker/dockerfile:1
22
FROM ubuntu:20.04
33

4-
RUN apt-get update
5-
RUN apt-get install -y \
4+
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
65
build-essential \
76
cgroup-lite \
87
cppreference-doc-en-html \
@@ -13,6 +12,7 @@ RUN apt-get install -y \
1312
libcups2-dev \
1413
libffi-dev \
1514
libpq-dev \
15+
libsystemd-dev \
1616
libyaml-dev \
1717
mono-mcs \
1818
openjdk-8-jdk-headless \

‎cms/grading/Sandbox.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1076,7 +1076,7 @@ def build_box_options(self):
10761076
if self.box_id is not None:
10771077
res += ["--box-id=%d" % self.box_id]
10781078
if self.cgroup:
1079-
res += ["--cg", "--cg-timing"]
1079+
res += ["--cg"]
10801080
if self.chdir is not None:
10811081
res += ["--chdir=%s" % self.chdir]
10821082
for src, dest, options in self.dirs:

‎docker-compose.test.yml‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,16 @@ services:
1919
volumes:
2020
- "./codecov:/home/cmsuser/cms/codecov"
2121
privileged: true
22+
cgroup: host
2223
command: >
2324
wait-for-it testdb:5432 -- sh -c "
25+
sudo mkdir /run/isolate ;
26+
echo /sys/fs/cgroup | sudo tee /run/isolate/cgroup ;
27+
isolate --print-cg-root ;
28+
isolate-check-environment ;
29+
isolate --cg --box-id 1 --init ;
30+
ls /sys/fs/cgroup/box-1 ;
31+
isolate --cg --box-id 1 --clean ;
2432
dropdb --host=testdb --username=postgres cmsdbfortesting ;
2533
createdb --host=testdb --username=postgres cmsdbfortesting ;
2634
cmsInitDB ;

‎prerequisites.py‎

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -195,9 +195,9 @@ def build_isolate():
195195
assert_not_root()
196196

197197
print("===== Compiling isolate")
198-
# We make only the executable isolate, otherwise the tool a2x
199-
# is needed and we have to add more compilation dependencies.
200-
subprocess.check_call(["make", "-C", "isolate", "isolate"])
198+
# We make only the executable isolate and isolate-cg-keeper, otherwise the
199+
# tool a2x is needed and we have to add more compilation dependencies.
200+
subprocess.check_call(["make", "--directory", "isolate", "isolate", "isolate-cg-keeper"])
201201

202202

203203
def install_isolate():
@@ -214,7 +214,7 @@ def install_isolate():
214214
exit(1)
215215

216216
# Check if build_isolate() has been called
217-
if not os.path.exists(os.path.join("isolate", "isolate")):
217+
if not os.path.exists(os.path.join("isolate", "isolate")) or not os.path.exists(os.path.join("isolate", "isolate-cg-keeper")):
218218
print("[Error] You must run the build_isolate command first")
219219
exit(1)
220220

@@ -224,6 +224,18 @@ def install_isolate():
224224
os.path.join(USR_ROOT, "bin", "isolate"),
225225
root, 0o4750, group=cmsuser_grp)
226226

227+
print("===== Copying isolate-cg-keeper to /usr/local/bin/")
228+
makedir(os.path.join(USR_ROOT, "bin"), root, 0o755)
229+
copyfile(os.path.join(".", "isolate", "isolate-cg-keeper"),
230+
os.path.join(USR_ROOT, "bin", "isolate-cg-keeper"),
231+
root, 0o4750, group=cmsuser_grp)
232+
233+
print("===== Copying isolate-check-environment to /usr/local/bin/")
234+
makedir(os.path.join(USR_ROOT, "bin"), root, 0o755)
235+
copyfile(os.path.join(".", "isolate", "isolate-check-environment"),
236+
os.path.join(USR_ROOT, "bin", "isolate-check-environment"),
237+
root, 0o4750, group=cmsuser_grp)
238+
227239
print("===== Copying isolate config to /usr/local/etc/")
228240
makedir(os.path.join(USR_ROOT, "etc"), root, 0o755)
229241
copyfile(os.path.join(".", "isolate", "default.cf"),
@@ -374,6 +386,8 @@ def uninstall():
374386

375387
print("===== Deleting isolate from /usr/local/bin/")
376388
try_delete(os.path.join(USR_ROOT, "bin", "isolate"))
389+
try_delete(os.path.join(USR_ROOT, "bin", "isolate-cg-keeper"))
390+
try_delete(os.path.join(USR_ROOT, "bin", "isolate-check-environment"))
377391

378392
print("===== Deleting configuration to /usr/local/etc/")
379393
if ask("Type Y if you really want to remove configuration files: "):

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL