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

Commit

Permalink
Merge pull request #35 from katulu-io/GerardoGR/edge-identity-docs
Browse files Browse the repository at this point in the history
Link edge-identity detail view with new edge installation-guide
  • Loading branch information
GerardoGR authored Aug 31, 2022
2 parents 10c81f0 + 6f652c2 commit 3a64156
Show file tree
Hide file tree
Showing 11 changed files with 95 additions and 269 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@

<pre style="background-color: #f1f1f1; padding: 10px; text-overflow: ellipsis; overflow: hidden;">{{ crdText }}</pre>

<p>
For more information on how to setup and provision an edge, visit the
<a href="https://katulu.io/en/docs/installation-guide-edge">Edge installation guide</a>
</p>

<button mat-raised-button type="button" class="form--button-margin" (click)="onCancel()" i18n>
CLOSE
</button>
Expand Down
32 changes: 0 additions & 32 deletions docs/example/fl-edge/config/agent.conf

This file was deleted.

85 changes: 1 addition & 84 deletions docs/example/fl-edge/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,87 +3,4 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- ../../release-manifests/fl-edge/kustomize/fl-edge/overlays/

replacements:
- source:
kind: ConfigMap
name: fl-operator-params
namespace: katulu-fl
fieldPath:
data.fl_orchestrator_sni
targets:
- select:
name: floperator-sample
namespace: katulu-fl
kind: FlOperator
fieldPaths:
- spec.orchestrator-url
- spec.orchestrator-sni
- source:
kind: ConfigMap
name: fl-operator-params
namespace: katulu-fl
fieldPath:
data.fl_orchestrator_port
targets:
- select:
name: floperator-sample
namespace: katulu-fl
kind: FlOperator
fieldPaths:
- spec.orchestrator-port
options:
create: true

patches:
- patch: |-
- op: add
path: /spec/template/spec/containers/0/env
value:
- name: SPIRE_AGENT_JOIN_TOKEN
valueFrom:
secretKeyRef:
name: spire-server-creds
key: spire_agent_join_token
- name: SPIRE_AGENT_SERVER_ADDRESS
valueFrom:
secretKeyRef:
name: spire-server-creds
key: spire_agent_server_address
- op: remove
path: /spec/template/spec/initContainers
target:
group: apps
version: v1
kind: DaemonSet
name: spire-agent
namespace: spire
configMapGenerator:
- name: fl-operator-params
namespace: katulu-fl
envs:
- config/fl-operator-params.env

- name: spire-agent
namespace: spire
behavior: replace
files:
- config/agent.conf

secretGenerator:
- name: regcred
namespace: katulu-fl
type: kubernetes.io/dockerconfigjson
files:
- .dockerconfigjson=config/internal-registry-credentials.json

- name: spire-server-creds
namespace: spire
type: Opaque
envs:
- config/spire-server-creds.env

generatorOptions:
disableNameSuffixHash: true
- ../../release-manifests/fl-edge/kustomize/fl-operator/base/
62 changes: 0 additions & 62 deletions docs/init-edge.sh

This file was deleted.

89 changes: 89 additions & 0 deletions docs/installation-guide-edge.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
---
title: Installation guide - Edge
label: Installation guide - Edge
subline:
description:
preview:
priority: 1
keywords:
- Machine-learning
- Federated-learning
- Open-Source
---

# Installation guide - Edge

To deploy a `fl-edge` it is expected to have the following requirements fulfilled:

## Requirements

* An instance of the fl-suite running.
* A Kubernetes cluster (< `v1.21.x`) running, e.g [EKS](https://docs.aws.amazon.com/eks/latest/userguide/create-cluster.html), [GKE](https://cloud.google.com/kubernetes-engine/docs/deploy-app-cluster#create_cluster), [AKS](https://docs.microsoft.com/en-us/azure/aks/kubernetes-walkthrough#create-aks-cluster) or on-prem:
> 📝 Kubernetes < `v1.21.x` is needed due to [`no matches for kind "CustomResourceDefinition error`](https://github.com/kubeflow/manifests/issues/2028)
* [kubectl installed](https://kubernetes.io/docs/tasks/tools/#kubectl) and [configured](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/) to use the kubernetes cluster.
* [kustomize installed](https://kubectl.docs.kubernetes.io/installation/kustomize/).
* [curl](https://curl.se/download.html).
* [python3](https://www.python.org/downloads/): To fetch the latest release tag.
* The [fl-suite repository](https://github.com/katulu-io/fl-suite) cloned and current working directory in `/path/to/cloned/fl-suite/docs`

## Deploy a fl-edge

### 1. Download the fl-edge manifests:

```shell
LATEST_RELEASE_URL=$(curl -s "https://api.github.com/repos/katulu-io/fl-suite/releases/latest")
FL_EDGE_MANIFESTS_URL=$(echo $LATEST_RELEASE_URL | python3 -c 'import json,sys;print(json.load(sys.stdin)["assets"][0]["url"])')
mkdir -p release-manifests/fl-edge && curl -s -L -H "Accept: application/octet-stream" "$FL_EDGE_MANIFESTS_URL" | tar xzf - --strip-components=1 -C release-manifests/fl-edge
```

### 2. Install the fl-edge manifests

```shell
while ! kustomize build example/fl-edge | kubectl apply -f -; do echo "Retrying to apply resources"; sleep 10; done
```

Wait for all the pods to be ready:

```shell
kubectl get pods -n fl-operator-system
```

### 3. Create a new edge-identity

Go to the running instance of the fl-suite and create a new edge:

![](../images/fl-suite-menu.png)
<br />

![](../images/fl-suite-edges.png)
<br />

![](../images/fl-suite-edge-form.png)
<br />

### 4. Deploy the edge-identity resources

Copy the resources from the new edge by pressing the *Copy* button:

![](../images/fl-suite-new-edge.png)
<br />

Apply the resources into the fl-edge kubernetes cluster:

```shell
kubectl apply -f - <<EOF
(paste resources here)
EOF
fledge.fl.katulu.io/my-edge created
floperator.fl.katulu.io/my-edge created
secret/regcred created
```

Wait for the edge pods to be ready:

```shell
kubectl get pods -n my-edge-spire-agent
kubectl get pods
```

After this the edge is ready to start processing federated learning jobs!. For a quick example check the [quickstart documentation](quickstart.md).
75 changes: 0 additions & 75 deletions docs/installation-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,78 +115,3 @@ You can now open your browser and visit http://localhost:8080/. You should get t
![](../images/fl-suite-notebook.png)

<br />


## Deploy a fl-edge

To emulate an edge deployment we will use [kind](https://kind.sigs.k8s.io).

### 1. Download the fl-edge manifests:

```shell
LATEST_RELEASE_URL=$(curl -s "https://api.github.com/repos/katulu-io/fl-suite/releases/latest")
FL_EDGE_MANIFESTS_URL=$(echo $LATEST_RELEASE_URL | python3 -c 'import json,sys;print(json.load(sys.stdin)["assets"][0]["url"])')
mkdir -p release-manifests/fl-edge && curl -s -L -H "Accept: application/octet-stream" "$FL_EDGE_MANIFESTS_URL" | tar xzf - --strip-components=1 -C release-manifests/fl-edge
```

### 2. Create the kubernetes edge cluster

> 🌻 It is expected that KUBECONFIG is configured to access the cluster used in the [Deploy fl-suite](#Deploy-fl-suite) steps.
```shell
curl -s https://raw.githubusercontent.com/katulu-io/fl-suite/beta/docs/init-edge.sh | bash
Entry ID : b254ae23-bc60-4e7e-98af-963f71aebeff
SPIFFE ID : spiffe://katulu.io/flower-client
Parent ID : spiffe://katulu.io/hostname-local-edge
Revision : 0
TTL : default
Selector : k8s:node-name:local-edge-control-plane
Selector : k8s:ns:katulu-fl
Selector : k8s:pod-label:app:flower-client

Entry ID : de6a9efb-7c26-48c5-b1ea-216dc18c556f
SPIFFE ID : spiffe://katulu.io/fl-operator
Parent ID : spiffe://katulu.io/hostname-local-edge
Revision : 0
TTL : default
Selector : k8s:node-name:local-edge-control-plane
Selector : k8s:ns:katulu-fl
Selector : k8s:pod-label:app:fl-operator-envoyproxy

Creating cluster "local-edge" ...
✓ Ensuring node image (kindest/node:v1.21.10) 🖼
✓ Preparing nodes 📦
✓ Writing configuration 📜
✓ Starting control-plane 🕹️
✓ Installing CNI 🔌
✓ Installing StorageClass 💾
Set kubectl context to "kind-local-edge"
You can now use your cluster with:

kubectl cluster-info --context kind-local-edge --kubeconfig local-edge-kubeconfig.yaml

Have a question, bug, or feature request? Let us know! https://kind.sigs.k8s.io/#community 🙂
```

Wait for the kubernetes' kind node is ready:

```shell
export KUBECONFIG=$(pwd)/local-edge-kubeconfig.yaml
kubernetes get nodes
NAME STATUS ROLES AGE VERSION
local-edge-control-plane Ready control-plane,master 11m v1.21.10
```

### 3. Deploy the kustomize manifests

```shell
while ! kustomize build example/fl-edge | kubectl apply -f -; do echo "Retrying to apply resources"; sleep 10; done
```

Wait for all the pods to be ready:

```shell
kubectl get pods -n spire
kubectl get pods -n fl-operator-system
kubectl get pods -n katulu-fl
```
16 changes: 0 additions & 16 deletions docs/teardown-edge.sh

This file was deleted.

Binary file added images/fl-suite-edge-form.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/fl-suite-edges.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/fl-suite-menu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/fl-suite-new-edge.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 3a64156

Please sign in to comment.