Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Option of defining an environment script for starting engines (with SSHEngineSetLauncher)

Aperta
#1,029 9 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
python, shell

Direzione di ricerca

Inizia leggendo SSHEngineSetLauncher e SSHLauncher, poi esamina il piccolo script di test multipiattaforma descritto nell’issue e la gestione dell’ambiente da parte di subprocess.Popen. Il lavoro è completato quando uno script di ambiente può preparare l’ambiente dell’engine su Linux e Windows senza fare in modo che l’handle del processo Python punti alla shell, con test di implementazione e documentazione.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

We need to adapt the environment before starting the actual ipp engine (through the SSHEngineSetLauncher). Adapting the environment via the environment parameter (in class SSHLauncher) is possible, but it's not very practical, since the launcher needs to know all the engine computer details in advance.
Calling a local environment script before starting the engine would give much more flexibility and would easily allow starting the engine e.g. in a python virtual environment, conda environment, etc.

Although the general idea is quite simple the actual implement is not as easy. The problem: one cannot simply start a shell, next the environment script and then the actual command because the process handle (in python) would point to the shell and not the actual command. Hence, the retrieved process id would be incorrect. Using some system code it would be still possible to retrieve the true process id, but this is especially difficult in windows which is why I tested an alternative solution:
Starting a shell, outputting all environment variable, running the environment script and outputting all environment variable again. A bit of python code analyses the output and collects the environment variable changes (especially added and/or changed env.vars). I have implemented a small test script that works under linux and windows.
The collected changes can then be easily passed to the env parameter of subprocess.Popen function.

Does this sound like an appropriate idea and solution?
As before I'm happy to provide the implementation, tests, documentation, etc.

Lingua principale
Jupyter Notebook
Stelle
2.6k
Fork
1k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di ipython/ipyparallel

Tutte le issue di ipython/ipyparallel

Issue simili

Altre issue su Distributed Systems

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.