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

Epic: Computational environments refactoring #4129

Merged
merged 65 commits into from
May 24, 2019
Merged

Conversation

Wiezzel
Copy link

@Wiezzel Wiezzel commented Apr 24, 2019

No description provided.

Wiezzel added 29 commits March 21, 2019 09:04
Used `golem.envs` instead of `golem.environments` because we don't want
to replace the old environments *yet*. The old package will be removed
when we are done.

Environment events should probably be somehow defined.

We can think of using `NewType` for all ID types so that one would have
to use the type explicitly.
It's slightly different than restart_ctx() and makes more sense to use
when reconfiguring the VM:
 * restart_ctx -> force VM restart
 * reconfig_ctx -> put machine in appropriate state for reconfiguration
   but don't power it up if it wasn't running before the call
Also provided default implementations for all the contexts in Hypervisor
abstract class.
Subtyping NamedTuple caused some weird typechecker issues.
+ Added hypervisor error handling in prepare() and cleanup()
Creating _Data classes was necessary because NamedTuple must be the only
superclass for its direct subclasses.
* Use existing `DictSerializable` instead of a new class
* Make `Hypervisor.is_available()` an abstract method
* Copy data in `from_dict()` methods not to modify arguments
* Rename `prepare_prerequisites()` to `install_prerequisites()`
Having arguments as a separate field only complicates things. They can
be added as part of `command` string.
Non Docker-specific methods for managing status changes have been moved
to the Runtime abstract base class.
Wiezzel added 25 commits May 9, 2019 11:06
Also fixed a minor bug with warnings format (Docker API returns `None`
when there are no warnings).
client.attach_socket() returns different types depending on OS. This
caused issues with stdin on Linux.
Calling shutdown() on a closed socket would raise an error so a flag was
added to make sure that this doesn't happen.

Added a comment, removed trailing newline.
Whitelist the image to be downloaded. Check if download was successful.
Starting status update loop before setting status to 'RUNNING' would
make the loop exit instantly and not update status.
ENV_ENABLED -> ENABLED
ENV_DISABLED -> DISABLED
Callback could potentially execute for a long time so defer them not to
block the main thread.
We don't need this. All commands are executed via docker-py.
Because 'cleanup' is a noun and method names should be verbs.
@Wiezzel Wiezzel marked this pull request as ready for review May 24, 2019 11:10
@codecov
Copy link

codecov bot commented May 24, 2019

Codecov Report

Merging #4129 into develop will increase coverage by 0.26%.
The diff coverage is 93.27%.

@@             Coverage Diff             @@
##           develop    #4129      +/-   ##
===========================================
+ Coverage    88.46%   88.73%   +0.26%     
===========================================
  Files          216      222       +6     
  Lines        18806    19574     +768     
===========================================
+ Hits         16637    17369     +732     
- Misses        2169     2205      +36

@Wiezzel Wiezzel merged commit fcf38e8 into develop May 24, 2019
@Wiezzel Wiezzel deleted the epic/env_refactor branch May 24, 2019 11:59
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants