Skip to content

Commit

Permalink
[cuebot/rqd] Add feature to run frames on a containerized environment…
Browse files Browse the repository at this point in the history
… using docker (#1549)

### Motivation

Running OpenCue In a multi operational system environment requires
segregating the farm, which means hosts have to be assigned to one OS
and cannot be shared between shows that have different OS requirements.
This can be a challenge when sharing resources between shows is
necessary.

### Proposed solution

A new execution mode on **rqd** `runDocker` to live alongside
`runLinux`, `runWindows`, and `runDarwin` (macOs). This mode will launch
the frame command on a docker container based on the frame expected OS.
With this, rqd is now able to run jobs from different OSs on the same
host.

But to make this possible, a rqd host needs to advertise itself not with
its own OS code (defined by `SP_OS` on rqd.conf), but with all the OSs
of images it is capable of executing.

### Configuration changes
The following sections were added to rqd.conf:

```ini
[docker.config]
# Setting this to True requires all the additional "docker.[]" sections to be filled
RUN_ON_DOCKER=True

# This section is only required if RUN_ON_DOCKER=True
# List of volume mounts following docker run's format, but replacing = with :
[docker.mounts]
TEMP=type:bind,source:/tmp,target:/tmp,bind-propagation:slave
NET=type:bind,source:/net,target:/net,bind-propagation:slave

# This section is only required if RUN_ON_DOCKER=True
#  - keys represent OSs this rqd is capable of executing jobs in
#  - values are docker image tags
[docker.images]
centos7=centos7.3:latest
rocky9=rocky9.3:latest
```

In this case, the rqd host would advertise itself with
`OS=centos7,rocky9`, and the dispatch logic has been changed accordingly
to account for dispatching frames to nodes that support multiple OSs.

Feature has been documented at AcademySoftwareFoundation/opencue.io#302
---------

Signed-off-by: Diego Tavares <[email protected]>
  • Loading branch information
DiegoTavares authored Nov 15, 2024
1 parent 9d48e2c commit 291b694
Show file tree
Hide file tree
Showing 26 changed files with 1,747 additions and 1,254 deletions.
11 changes: 0 additions & 11 deletions .github/workflows/testing-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,6 @@ on:
branches: [ master ]

jobs:
test_python_2022:
name: Run Python Unit Tests (CY2022)
runs-on: ubuntu-22.04
container: aswf/ci-opencue:2022
env:
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
steps:
- uses: actions/checkout@v3
- name: Run Python Tests
run: ci/run_python_tests.sh --no-gui

test_cuebot_2022:
name: Build Cuebot and Run Unit Tests (CY2022)
runs-on: ubuntu-22.04
Expand Down
2 changes: 1 addition & 1 deletion VERSION.in
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0
1.1
1 change: 0 additions & 1 deletion ci/run_python_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ PYTHONPATH=pycue python -m unittest discover -s cueadmin/tests -t cueadmin -p "*
PYTHONPATH=pycue:pyoutline python -m unittest discover -s cuesubmit/tests -t cuesubmit -p "*.py"
python -m pytest rqd/tests


# Xvfb no longer supports Python 2.
if [[ "$python_version" =~ "Python 3" && ${args[0]} != "--no-gui" ]]; then
ci/run_gui_test.sh
Expand Down
3 changes: 3 additions & 0 deletions cuebot/src/main/java/com/imageworks/spcue/DispatchFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,8 @@ public class DispatchFrame extends FrameEntity implements FrameInterface {

// A comma separated list of services
public String services;

// The Operational System this frame is expected to run in
public String os;
}

10 changes: 9 additions & 1 deletion cuebot/src/main/java/com/imageworks/spcue/DispatchHost.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public class DispatchHost extends Entity
public long gpuMemory;
public long idleGpuMemory;
public String tags;
public String os;
private String os;

public boolean isNimby;
public boolean isLocalDispatch = false;
Expand Down Expand Up @@ -81,6 +81,14 @@ public String getFacilityId() {
return facilityId;
}

public String[] getOs() {
return this.os.split(",");
}

public void setOs(String os) {
this.os = os;
}

public boolean canHandleNegativeCoresRequest(int requestedCores) {
// Request is positive, no need to test further.
if (requestedCores > 0) {
Expand Down
8 changes: 5 additions & 3 deletions cuebot/src/main/java/com/imageworks/spcue/VirtualProc.java
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@ public String getName() {
* @param frame
* @return
*/
public static final VirtualProc build(DispatchHost host, DispatchFrame frame, String... selfishServices) {
public static final VirtualProc build(DispatchHost host,
DispatchFrame frame,
String... selfishServices) {
VirtualProc proc = new VirtualProc();
proc.allocationId = host.getAllocationId();
proc.hostId = host.getHostId();
Expand All @@ -94,7 +96,7 @@ public static final VirtualProc build(DispatchHost host, DispatchFrame frame, St
proc.jobId = frame.getJobId();
proc.showId = frame.getShowId();
proc.facilityId = frame.getFacilityId();
proc.os = host.os;
proc.os = frame.os;

proc.hostName = host.getName();
proc.unbooked = false;
Expand Down Expand Up @@ -238,7 +240,7 @@ public static final VirtualProc build(DispatchHost host,
proc.jobId = frame.getJobId();
proc.showId = frame.getShowId();
proc.facilityId = frame.getFacilityId();
proc.os = host.os;
proc.os = frame.os;

proc.hostName = host.getName();
proc.unbooked = false;
Expand Down
Loading

0 comments on commit 291b694

Please sign in to comment.