Skip to content

Commit

Permalink
save state
Browse files Browse the repository at this point in the history
Signed-off-by: vsoch <[email protected]>
  • Loading branch information
vsoch committed Jun 27, 2024
1 parent aaf6ec9 commit f8254dc
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 26 deletions.
1 change: 1 addition & 0 deletions config/manager/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ kind: Kustomization
images:
- name: controller
newName: ghcr.io/flux-framework/flux-operator
newTag: test
10 changes: 2 additions & 8 deletions examples/experimental/multiple-pods-per-node/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,12 @@ gcloud container clusters create test-cluster \

### Install the Flux Operator

We are going to install the Flux operator from the refactor branch (with the feature added to disable affinity).
As follows:

```bash
git clone -b test-refactor-modular
cd test-refactor-modular

# You might need other dependencies, etc. here or to specify your own registry you can push to.
make test-deploy-recreate
kubectl apply -f https://raw.githubusercontent.com/flux-framework/flux-operator/main/examples/dist/flux-operator.yaml
```

If/when this is released, you can install from a release.

### Experiments

Then create the flux operator pods.
Expand Down
2 changes: 1 addition & 1 deletion examples/tests/osu-benchmarks/minicluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ spec:
containers:
- image: ghcr.io/converged-computing/metric-osu-benchmark:latest
workingDir: /opt/osu-benchmark/build.openmpi/libexec/osu-micro-benchmarks/mpi/one-sided
command: ./osu_get_latency
command: ./osu_get_latency
37 changes: 37 additions & 0 deletions pkg/flux/templates/components.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,43 @@ command="/bin/bash ./custom-entrypoint.sh"
{{end}}
{{end}}

{{define "broker"}}
brokerOptions="-Scron.directory=/etc/flux/system/cron.d \
-Stbon.fanout=256 \
-Srundir=${viewroot}/run/flux {{ if .Spec.Interactive }}-Sbroker.rc2_none {{ end }} \
-Sstatedir=${STATE_DIR} \
-Slocal-uri=local://$viewroot/run/flux/local \
{{ if .Spec.Flux.ConnectTimeout }}-Stbon.connect_timeout={{ .Spec.Flux.ConnectTimeout }}{{ end }} \
{{ if .RequiredRanks }}-Sbroker.quorum={{ .RequiredRanks }}{{ end }} \
{{ if .Spec.Logging.Zeromq }}-Stbon.zmqdebug=1{{ end }} \
{{ if not .Spec.Logging.Quiet }} -Slog-stderr-level={{or .Spec.Flux.LogLevel 6}} {{ else }} -Slog-stderr-level=0 {{ end }} \
-Slog-stderr-mode=local"


# Run an interactive cluster, giving no command to flux start
function run_interactive_cluster() {
echo "🌀 flux broker --config-path ${cfg} ${brokerOptions}"
flux broker --config-path ${cfg} ${brokerOptions}
}
{{end}}

{{define "worker-broker"}}
cfg="${viewroot}/etc/flux/config"
brokerOptions="-Stbon.fanout=256 \
-Srundir=${viewroot}/run/flux {{ if .Spec.Interactive }}-Sbroker.rc2_none {{ end }} \
-Slocal-uri=local://$viewroot/run/flux/local \
{{ if .Spec.Flux.ConnectTimeout }}-Stbon.connect_timeout={{ .Spec.Flux.ConnectTimeout }}{{ end }} \
{{ if .Spec.Logging.Zeromq }}-Stbon.zmqdebug=1{{ end }} \
{{ if not .Spec.Logging.Quiet }} -Slog-stderr-level={{or .Spec.Flux.LogLevel 6}} {{ else }} -Slog-stderr-level=0 {{ end }} \
-Slog-stderr-mode=local"

# This is provided as an optional function for a worker
function run_interactive_cluster() {
echo "🌀 flux broker --config-path ${cfg} ${brokerOptions}"
flux broker --config-path ${cfg} ${brokerOptions}
}
{{end}}

{{define "paths"}}
foundroot=$(find $viewroot -maxdepth 2 -type d -path $viewroot/lib/python3\*) {{ if .Spec.Logging.Quiet }}> /dev/null 2>&1{{ end }}
pythonversion=$(basename ${foundroot})
Expand Down
2 changes: 2 additions & 0 deletions pkg/flux/templates/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ fluxsocket="local://$fluxsocket"
# Is a custom script provided?
{{template "custom-script" .}}

{{template "worker-broker" .}}

{{ .Container.Command }}

{{ .Container.Commands.Post}}
18 changes: 1 addition & 17 deletions pkg/flux/templates/wait.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,23 +82,7 @@ echo "The working directory is ${workdir}, contents include:"
ls .
{{ end }}

brokerOptions="-Scron.directory=/etc/flux/system/cron.d \
-Stbon.fanout=256 \
-Srundir=${viewroot}/run/flux {{ if .Spec.Interactive }}-Sbroker.rc2_none {{ end }} \
-Sstatedir=${STATE_DIR} \
-Slocal-uri=local://$viewroot/run/flux/local \
{{ if .Spec.Flux.ConnectTimeout }}-Stbon.connect_timeout={{ .Spec.Flux.ConnectTimeout }}{{ end }} \
{{ if .RequiredRanks }}-Sbroker.quorum={{ .RequiredRanks }}{{ end }} \
{{ if .Spec.Logging.Zeromq }}-Stbon.zmqdebug=1{{ end }} \
{{ if not .Spec.Logging.Quiet }} -Slog-stderr-level={{or .Spec.Flux.LogLevel 6}} {{ else }} -Slog-stderr-level=0 {{ end }} \
-Slog-stderr-mode=local"


# Run an interactive cluster, giving no command to flux start
function run_interactive_cluster() {
echo "🌀 flux broker --config-path ${cfg} ${brokerOptions}"
flux broker --config-path ${cfg} ${brokerOptions}
}
{{template "broker" .}}

# if we are given an archive to use, load first, not required to exist
# Note that we ask the user to dump in interactive mode - I am not
Expand Down

0 comments on commit f8254dc

Please sign in to comment.