Skip to content

Commit 3ed3762

Browse files
committed
Fixing github tests, cmake files, readme, ...
1 parent 60a9bd0 commit 3ed3762

File tree

8 files changed

+32
-38
lines changed

8 files changed

+32
-38
lines changed

.github/workflows/linux-build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on: [push, pull_request]
44

55
jobs:
66
tests:
7-
runs-on: ubuntu-20.04
7+
runs-on: ubuntu-22.04
88
steps:
99
- uses: actions/checkout@v2
1010
with:
@@ -30,7 +30,7 @@ jobs:
3030
run: sudo apt-get install -y libcap-dev
3131

3232
# install isolate
33-
- run: git clone https://github.com/ioi/isolate.git
33+
- run: git clone https://github.com/ReCodEx/isolate
3434
- run: make isolate
3535
working-directory: isolate
3636
- run: sudo make install

.github/workflows/windows-build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ jobs:
2727
- name: Install dependencies and prepare directory structure for cmake
2828
working-directory: libs
2929
run: |
30-
nuget install boost -ExcludeVersion -Version 1.72.0
30+
nuget install boost -ExcludeVersion -Version 1.74.0
3131
mv -Force ./boost/lib/native/include/ ./boost/
3232
33-
nuget install boost_system-vc142 -ExcludeVersion -Version 1.72.0
33+
nuget install boost_system-vc142 -ExcludeVersion -Version 1.74.0
3434
mv -Force ./boost_system-vc142/lib/native/* ./boost/lib/
3535
36-
nuget install boost_program_options-vc142 -ExcludeVersion -Version 1.72.0
36+
nuget install boost_program_options-vc142 -ExcludeVersion -Version 1.74.0
3737
mv -Force ./boost_program_options-vc142/lib/native/* ./boost/lib/
3838
3939
nuget install rmt_zlib -ExcludeVersion -Version 1.2.8.7

CMakeLists.txt

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
cmake_minimum_required(VERSION 3.11.0)
22
project(recodex-worker)
3-
set(RECODEX_VERSION 1.7.2)
3+
set(RECODEX_VERSION 1.8.0)
44
enable_testing()
55

6-
# Hack for old CentOS and new GCC with uncompatible ABI
7-
# add_definitions(-D_GLIBCXX_USE_CXX11_ABI=0)
8-
96
set(EXEC_NAME ${PROJECT_NAME})
107
set(gtest_force_shared_crt ON CACHE BOOL "Use shared (DLL) run-time lib even when Google Test is built as static lib.")
118

12-
# Find installed packages on system
9+
# Find installed packages on the system
1310
# -- LibArchive
1411
find_package(LibArchive)
1512

@@ -21,7 +18,7 @@ else()
2118
endif()
2219
# -- load Boost
2320
set (Boost_USE_MULTITHREADED ON)
24-
find_package(Boost 1.66.0 REQUIRED COMPONENTS filesystem system program_options)
21+
find_package(Boost 1.74.0 REQUIRED COMPONENTS system program_options)
2522
include_directories(${Boost_INCLUDE_DIRS})
2623

2724
# -- cURL

README.md

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -10,39 +10,37 @@
1010
[![COPR](https://copr.fedorainfracloud.org/coprs/semai/ReCodEx/package/recodex-worker/status_image/last_build.png)](https://copr.fedorainfracloud.org/coprs/semai/ReCodEx/)
1111

1212
The job of the worker is to securely execute a job according to its
13-
configuration and upload results back for latter processing. After receiving an
14-
evaluation request, worker has to do following:
13+
configuration and upload results back for later processing. After receiving an
14+
evaluation request, a worker has to do the following:
1515

16-
- download the archive containing submitted source files and configuration file
16+
- download the archive containing the submitted source files and configuration file
1717
- download any supplementary files based on the configuration file, such as test
1818
inputs or helper programs (this is done on demand, using a `fetch` command
1919
in the assignment configuration)
20-
- evaluate the submission according to job configuration
21-
- during evaluation progress messages can be sent back to broker
20+
- evaluate the submission according to the job configuration
21+
- during evaluation progress messages can be sent back to the broker
2222
- upload the results of the evaluation to the fileserver
23-
- notify broker that the evaluation finished
23+
- notify the broker that the evaluation finished
2424

2525
## Installation
2626

2727
### COPR Installation
28-
29-
Follows description for CentOS which will do all steps as described in _Manual Installation_.
28+
Follows the description for RHEL-like systems which will do all steps as described in _Manual Installation_.
3029

3130
```
32-
# yum install yum-plugin-copr
33-
# yum copr enable semai/ReCodEx
34-
# yum install recodex-worker
31+
# dnf install dnf-plugin-copr
32+
# dnf copr enable semai/ReCodEx
33+
# dnf install recodex-worker
3534
```
3635

3736
### Manual Installation
3837

3938
#### Dependencies
40-
41-
Worker specific requirements are written in this section. It covers only basic
39+
Worker-specific requirements are written in this section. It covers only basic
4240
requirements, additional runtimes or tools may be needed depending on type of
43-
use. The package names are for CentOS if not specified otherwise.
41+
use. The package names are for CentOS if not specified otherwise.
4442

45-
- Boost 1.70 development libs (`boost-devel` package)
43+
- Boost 1.74 development libs or newer (`boost-devel` package, or `libboost-all-dev` on Debian/Ubuntu)
4644
- ZeroMQ in version at least 4.0, packages `zeromq` and `zeromq-devel`
4745
(`libzmq3-dev` on Debian)
4846
- YAML-CPP library, `yaml-cpp` and `yaml-cpp-devel` (`libyaml-cpp0.5v5` and
@@ -55,21 +53,20 @@ use. The package names are for CentOS if not specified otherwise.
5553

5654
**Isolate** (only for Linux installations)
5755

58-
First, we need to compile sandbox Isolate from source and install it. Current
59-
worker is tested against version 1.3, so this version needs to be checked out.
60-
Assume that we keep source code in `/opt/src` dir. For building man page you
56+
First, we need to compile sandbox Isolate from the source and install it. The current
57+
worker is tested against our local clone which has some patches in it, so this version needs to be checked out.
58+
Assume that we keep the source code in `/opt/src` dir. For building man page you
6159
need to have package `asciidoc` installed.
6260

6361
```
6462
$ cd /opt/src
65-
$ git clone https://github.com/ioi/isolate.git
63+
$ git clone https://github.com/ReCodEx/isolate
6664
$ cd isolate
67-
$ git checkout v1.3
6865
$ make
6966
# make install && make install-doc
7067
```
7168

72-
For proper work Isolate depends on several advanced features of the Linux
69+
For proper work, Isolate depends on several advanced features of the Linux
7370
kernel. Make sure that your kernel is compiled with `CONFIG_PID_NS`,
7471
`CONFIG_IPC_NS`, `CONFIG_NET_NS`, `CONFIG_CPUSETS`, `CONFIG_CGROUP_CPUACCT`,
7572
`CONFIG_MEMCG`. If your machine has swap enabled, also check
@@ -107,7 +104,7 @@ worker source codes.
107104
that `rpm` and `deb` packages are build in the same time. You may need to have
108105
`rpmbuild` command (usually as `rpmbuild` or `rpm` package) or edit
109106
CPACK_GENERATOR variable in _CMakeLists.txt_ file in root of source code tree.
110-
- Install generated package through your package manager (`yum`, `dnf`, `dpkg`).
107+
- Install generated package through your package manager (`dnf`, `dnf`, `dpkg`).
111108

112109
The worker installation process is composed of following steps:
113110

src/archives/archivator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ void archivator::compress(const std::string &dir, const std::string &destination
2525
// find out where the two paths diverge - std::filesystem::relative() is too new now to use it
2626
fs::path::const_iterator itr_dir = dir_path.begin();
2727
fs::path::const_iterator itr_file = file.begin();
28-
while (*itr_dir == *itr_file && itr_dir != dir_path.end()) {
28+
while (itr_dir != dir_path.end() && itr_file != file.end() && *itr_dir == *itr_file) {
2929
++itr_dir;
3030
++itr_file;
3131
}

src/fileman/cache_manager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ void cache_manager::get_file(const std::string &src_name, const std::string &dst
4242
fs::perms::owner_write | fs::perms::group_write | fs::perms::others_write,
4343
fs::perm_options::add);
4444
// change last modification time of the file
45-
fs::last_write_time(source_file, std::filesystem::file_time_type::min());
45+
fs::last_write_time(source_file, fs::file_time_type::clock::now());
4646
} catch (fs::filesystem_error &e) {
4747
auto message = "Failed to copy file '" + source_file.string() + "' to '" + dst_path + "'. Error: " + e.what();
4848
logger_->warn(message);

tests/isolate_sandbox.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#ifndef _WIN32
1+
#ifdef TEST_ISOLATE
22

33
#include <gtest/gtest.h>
44
#include <gmock/gmock.h>

tests/job.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -784,8 +784,8 @@ TEST(job_test, job_variables)
784784

785785
auto bnd_dirs = limits->bound_dirs;
786786
ASSERT_EQ(bnd_dirs.size(), 1u);
787-
ASSERT_EQ(path(std::get<0>(bnd_dirs[0])).string(), (temp_directory_path() / "recodex").string());
788-
ASSERT_EQ(path(std::get<1>(bnd_dirs[0])).string(), (dir / "tmp").string());
787+
ASSERT_EQ(path(std::get<0>(bnd_dirs[0])), (temp_directory_path() / "recodex"));
788+
ASSERT_EQ(path(std::get<1>(bnd_dirs[0])), (dir / "tmp"));
789789

790790
// cleanup after yourself
791791
remove_all(dir_root);

0 commit comments

Comments
 (0)