Skip to content

Commit 0fecee8

Browse files
committed
Merge remote-tracking branch 'origin/main' into remove_conda
# Conflicts: # .ci_support/environment-mpich.yml # .ci_support/environment-openmpi.yml # .ci_support/environment-win.yml # pyproject.toml
2 parents 76291be + 1c2ea20 commit 0fecee8

File tree

8 files changed

+110
-7
lines changed

8 files changed

+110
-7
lines changed

.ci_support/environment-mpich.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ dependencies:
1111
- h5io =0.2.4
1212
- matplotlib =3.9.2
1313
- networkx =3.3
14-
- pygraphviz =1.13
14+
- pygraphviz =1.14
1515
- ipython =8.27.0

.ci_support/environment-openmpi.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ dependencies:
1111
- h5io =0.2.4
1212
- matplotlib =3.9.2
1313
- networkx =3.3
14-
- pygraphviz =1.13
14+
- pygraphviz =1.14
1515
- ipython =8.27.0

.ci_support/environment-win.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ dependencies:
1111
- h5io =0.2.4
1212
- matplotlib =3.9.2
1313
- networkx =3.3
14-
- pygraphviz =1.13
14+
- pygraphviz =1.14
1515
- ipython =8.27.0

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/astral-sh/ruff-pre-commit
3-
rev: v0.6.4
3+
rev: v0.6.8
44
hooks:
55
- id: ruff
66
name: ruff lint

docs/_config.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
title: executorlib
22
author: Jan Janssen
3-
logo: images/pyiron-logo.png
43

54
execute:
65
execute_notebooks : off

docs/_toc.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ chapters:
44
- file: installation.md
55
- file: examples.ipynb
66
- file: development.md
7-
- file: api.rst
7+
- file: trouble_shooting.md
8+
- file: api.rst

docs/trouble_shooting.md

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
# Trouble shooting
2+
3+
## When `flux` fails:
4+
5+
### Step-by-Step Guide to Create a Custom Jupyter Kernel for Flux
6+
7+
#### Step 1: Create a New Kernel Specification
8+
9+
1. Install [`flux-core`](https://anaconda.org/conda-forge/flux-core) in your Jupyter environment:
10+
11+
```bash
12+
conda install -c conda-forge flux-core
13+
```
14+
15+
2. **Find the Jupyter Kernel Directory**:
16+
17+
Open your terminal or command prompt and run:
18+
19+
```bash
20+
jupyter --paths
21+
```
22+
23+
This command will display the paths where Jupyter looks for kernels. You'll usually find a directory named `kernels` under the `jupyter` data directory. You will create a new directory for the Flux kernel in the `kernels` directory.
24+
25+
3. **Create the Kernel Directory**:
26+
27+
Navigate to the kernels directory (e.g., `~/.local/share/jupyter/kernels` on Linux or macOS) and create a new directory called `flux`.
28+
29+
```bash
30+
mkdir -p ~/.local/share/jupyter/kernels/flux
31+
```
32+
33+
If you're using Windows, the path will be different, such as `C:\Users\<YourUsername>\AppData\Roaming\jupyter\kernels`.
34+
35+
4. **Create the `kernel.json` File**:
36+
37+
Inside the new `flux` directory, create a file named `kernel.json`:
38+
39+
```bash
40+
nano ~/.local/share/jupyter/kernels/flux/kernel.json
41+
```
42+
43+
Paste the following content into the file:
44+
45+
```json
46+
{
47+
"argv": [
48+
"flux",
49+
"start",
50+
"/srv/conda/envs/notebook/bin/python",
51+
"-m",
52+
"ipykernel_launcher",
53+
"-f",
54+
"{connection_file}"
55+
],
56+
"display_name": "Flux",
57+
"language": "python",
58+
"metadata": {
59+
"debugger": true
60+
}
61+
}
62+
```
63+
64+
- **`argv`**: This array specifies the command to start the Jupyter kernel. It uses `flux start` to launch Python in the Flux environment.
65+
- **`display_name`**: The name displayed in Jupyter when selecting the kernel.
66+
- **`language`**: The programming language (`python`).
67+
68+
**Note**:
69+
70+
- Make sure to replace `"/srv/conda/envs/notebook/bin/python"` with the correct path to your Python executable. You can find this by running `which python` or `where python` in your terminal.
71+
- If you installed `flux` in a specific environment, you have to write the absolute path to `flux` in the `argv` array.
72+
73+
#### Step 2: Restart Jupyter Notebook
74+
75+
1. **Restart the Jupyter Notebook Server**:
76+
77+
Close the current Jupyter Notebook server and restart it:
78+
79+
```bash
80+
jupyter notebook
81+
```
82+
83+
```bash
84+
jupyter lab
85+
```
86+
87+
Or simply restart your server.
88+
89+
2. **Select the Flux Kernel**:
90+
91+
When creating a new notebook or changing the kernel of an existing one, you should see an option for "Flux" in the list of available kernels. Select it to run your code with the Flux environment.
92+
93+
#### Step 3: Run Your Code with `FluxExecutor`
94+
95+
Now, your Jupyter environment is set up to use `flux-core`. You can run your code like this:
96+
97+
```python
98+
import flux.job
99+
100+
# Use FluxExecutor within the Flux kernel
101+
with flux.job.FluxExecutor() as flux_exe:
102+
print("FluxExecutor is running within the Jupyter Notebook")
103+
```

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ hdf = [
4141
"h5io==0.2.4",
4242
]
4343
graph = [
44-
"pygraphviz==1.13",
44+
"pygraphviz==1.14",
4545
"matplotlib==3.9.2",
4646
"networkx==3.3",
4747
"ipython==8.27.0",

0 commit comments

Comments
 (0)