Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

Non-hypervised Docker CPU Environment #4235

Merged
merged 8 commits into from
Jun 14, 2019
Merged

Conversation

Wiezzel
Copy link

@Wiezzel Wiezzel commented May 24, 2019

A temporary subclass of DockerCPUEnvironment that always uses DummyHypervisor and therefore performs no operations on Docker virtual machine. It is meant to enable usage of the new Environment API without removing DockerManager yet. Using standard DockerCPUEnvironment would cause potential conflicts during VM reconfiguration.

A temporary subclass of DockerCPUEnvironment that always uses
DummyHypervisor and therefore performs no operations on Docker virtual
machine. It is meant to enable usage of the new Environment API without
removing DockerManager yet. Using standard DockerCPUEnvironment would
cause potential conflicts during VM reconfiguration.
@Wiezzel Wiezzel self-assigned this May 24, 2019
Setting up DockerCPUEnvironment in TaskComputer.__init__() requires two
conditions to be met:
  * Twisted reactor running (because prepare() returns a Deferred)
  * ClientConfigDescriptor with proper memory and CPU settings
@Wiezzel Wiezzel force-pushed the env_refactor/non_hypervised_env branch from 6b2d253 to 5791443 Compare May 27, 2019 11:51
@Wiezzel Wiezzel added the clay label May 27, 2019
@Wiezzel Wiezzel marked this pull request as ready for review May 27, 2019 12:13
@Wiezzel Wiezzel changed the title Env refactor/non hypervised env Non-hypervised Docker CPU Environment May 27, 2019
Copy link
Contributor

@maaktweluit maaktweluit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

So many test patches.. at least it has good coverage :P

One small comment, still approving!

golem/task/taskcomputer.py Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented May 27, 2019

Codecov Report

Merging #4235 into develop will decrease coverage by 3.68%.
The diff coverage is 71.05%.

@@             Coverage Diff             @@
##           develop    #4235      +/-   ##
===========================================
- Coverage    88.56%   84.87%   -3.69%     
===========================================
  Files          224      224              
  Lines        19713    19725      +12     
===========================================
- Hits         17458    16741     -717     
- Misses        2255     2984     +729

Client.start() requires to be run with reactor.
@Wiezzel Wiezzel force-pushed the env_refactor/non_hypervised_env branch 3 times, most recently from 1a0ed96 to c490983 Compare June 5, 2019 14:48
@codecov
Copy link

codecov bot commented Jun 5, 2019

Codecov Report

Merging #4235 into develop will increase coverage by 0.2%.
The diff coverage is 98.68%.

@@            Coverage Diff            @@
##           develop   #4235     +/-   ##
=========================================
+ Coverage    88.49%   88.7%   +0.2%     
=========================================
  Files          224     225      +1     
  Lines        19715   19766     +51     
=========================================
+ Hits         17447   17533     +86     
+ Misses        2268    2233     -35

@Wiezzel Wiezzel force-pushed the env_refactor/non_hypervised_env branch 2 times, most recently from 4318b05 to 5e868e6 Compare June 5, 2019 15:54
When a task header with environment prerequistes is received provider
will attempt to install the specified prerequisites and report positive
support status only if the installation was succesful.
@Wiezzel Wiezzel force-pushed the env_refactor/non_hypervised_env branch from c464ef4 to a068932 Compare June 6, 2019 13:22
@Wiezzel Wiezzel force-pushed the env_refactor/non_hypervised_env branch from a068932 to db39955 Compare June 6, 2019 13:31
@Wiezzel Wiezzel requested a review from maaktweluit June 6, 2019 13:49
@Wiezzel
Copy link
Author

Wiezzel commented Jun 6, 2019

@mfranciszkiewicz @maaktweluit The code is ready for review. The only thing missing is Golem-Messages update. I'll update the requirements as soon as I get to release Golem-Messages with this change: golemfactory/golem-messages#349

Golem-Messages 3.8.0 version introduces environment_prerequisites field
to TaskHeader.
Copy link
Contributor

@maaktweluit maaktweluit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@@ -5,6 +5,7 @@
from tests.golem.task.dummy import runner, task


@mock.patch('golem.task.taskserver.NonHypervisedDockerCPUEnvironment')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fyi, if you use mock.Mock() as the second argument you won't need to put the extra _ argument in the test methods.

@Wiezzel Wiezzel merged commit 40fff80 into develop Jun 14, 2019
@Wiezzel Wiezzel deleted the env_refactor/non_hypervised_env branch June 14, 2019 06:58
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants