Comments (2)
I think this is definitely doable. I don't think that sharing instances directly between processes is safe, but I think there's a very simple solution.
Only one backend is created, using the user's configuration. This backend should be in the "main" process and persist though the lifetime of the program. When workflow instances are started, they each start their own backend from one of the two base classes. That way, they can connect to a functional slurm cluster without dealing with setup, cleanup, or state.
For example:
If the user wants to create a cluster using the TransientImage backend, one master instance is created, which spins up the cluster. Afterwards, new workflows in other processes can simply use the Local backend to connect to the existing cluster.
This would require adding a method to each backend that generates valid backend instances to connect to their own cluster.
LocalSlurmBackend -> LocalSlurmBackend
RemoteSlurmBackend -> RemoteSlurmBackend
TransientGCPSlurmBackend -> RemoteSlurmBackend (connect's to master node's hostname)
TransientImageSlurmBackend -> LocalSlurmBackend
DockerTransientImageSlurmBackend -> ?
DummySlurmBackend -> ?
The two docker-based backends would need a new barebones docker backend which simply invoke()
s commands through the slurm controller container
from canine.
The Docker backend does not store any state in the Python class, so it is already safe to spin up multiple Docker backends. 4aa362b allows the backend's __enter__
method to detect a valid running Slurm controller container and simply use that if it exists. The __exit__
method will not shut down the container if it was already running.
TODO: the __exit__
method should not shut down the NFS if the container was already running. However, this won't be fixed here, since I'm planning on deprecating the separate NFS server, and just running it from the controller machine.
I think we should have a separate wolF server process that spins up the controller container and Prefect server, but that's for another PR.
from canine.
Related Issues (20)
- delocalization.py should create relative symlinks, if possible HOT 1
- Remove distinction between controller and worker fs environments
- Cleanup docs HOT 1
- Output df
- If default GCP project is not set, immediately raise error in the constructor HOT 1
- Raise more informative error when no outputs are found HOT 3
- NFS creation from custom image fails silently HOT 2
- Use fallocate to enforce disk space HOT 1
- Add debug mode to `wait_for_jobs_to_finish`
- Dummy Backend hangs on linux VMs HOT 1
- orchestrator should attempt to run `delocalize.py` for jobs failed from node failures HOT 1
- Enable job shell variable expansion during delocalization
- Add job avoidance unit tests
- local override HOT 5
- Dummy backend on linux permissions issues HOT 3
- Stream localization fails on preemptible NFS server
- localization.sh fails with transfer_bucket
- Copy or symlink when delocalizing a directory? HOT 1
- scancel'ing noop'd jobs is slow HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from canine.