Compare commits
26 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ef89f4fbb8 | |||
| e439e06ac4 | |||
| cbf32fff48 | |||
| 90691a5ec7 | |||
| a4210d08c4 | |||
| be080d7511 | |||
| cc8d599ce5 | |||
| a7d1cc3429 | |||
| 934f00d749 | |||
| 9e1686a78d | |||
| 140bd63559 | |||
| 90cc774341 | |||
| db10baf460 | |||
| 53fca60178 | |||
| 8b53c2e70e | |||
|
|
3892692a07 | ||
| 7ec310f161 | |||
| ced5e55698 | |||
| 7cdb02b677 | |||
| 82aed0fdb6 | |||
| 626a1b1f22 | |||
| 3b7c3a9526 | |||
| 0a96827200 | |||
| fcb45ec331 | |||
| 47d0d993d8 | |||
| 333dfce355 |
4
.gitignore
vendored
4
.gitignore
vendored
@@ -1,3 +1 @@
|
|||||||
bin
|
k8s/deployed_config
|
||||||
*.base64
|
|
||||||
env
|
|
||||||
34
Makefile
34
Makefile
@@ -1,34 +0,0 @@
|
|||||||
#!make
|
|
||||||
|
|
||||||
include env
|
|
||||||
export
|
|
||||||
|
|
||||||
ifndef OC_VERSION
|
|
||||||
$(error OC_VERSION is not set)
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifndef PUBLISH_TOKEN
|
|
||||||
$(error PUBLISH_TOKEN is not set)
|
|
||||||
endif
|
|
||||||
|
|
||||||
PUBLISH_REPO := "core/oc-deploy"
|
|
||||||
PUBLISH_BRANCH := main
|
|
||||||
|
|
||||||
help:
|
|
||||||
@echo
|
|
||||||
@echo 'Usage:'
|
|
||||||
@echo ' make publish'
|
|
||||||
@echo ' make clean'
|
|
||||||
|
|
||||||
.PHONY: publish
|
|
||||||
publish:
|
|
||||||
@echo Publication de : ${OC_VERSION}
|
|
||||||
@(cd src && make --quiet build VERSION=$(OC_VERSION))
|
|
||||||
@(cd publish && \
|
|
||||||
PUBLISH_REPO=${PUBLISH_REPO} \
|
|
||||||
PUBLISH_TOKEN=${PUBLISH_TOKEN} \
|
|
||||||
PUBLISH_BRANCH=${PUBLISH_BRANCH} \
|
|
||||||
go run main.go ${OC_VERSION})
|
|
||||||
|
|
||||||
clean:
|
|
||||||
@rm *.base64
|
|
||||||
203
README.md
203
README.md
@@ -1,117 +1,134 @@
|
|||||||
|
# RUN DOCKER DEMO
|
||||||
|
|
||||||
|
ADD a clean argo
|
||||||
|
```
|
||||||
|
./run_argo.sh
|
||||||
|
```
|
||||||
|
Verify with `kubectl get pods -n argo -w` -> all server are running and 1/1
|
||||||
|
Any problem with this, can be a top problem from your k3s or k8s (FIX IT BEFORE)
|
||||||
|
|
||||||
|
```
|
||||||
|
sudo ./clone_opencloud_microservices.sh demo-alpr
|
||||||
|
cd ./docker
|
||||||
|
./start-demo.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
GO on localhost:8000, prefer a "chromium-browser --disable-web-security" chrome no CORS session to reach img.
|
||||||
|
|
||||||
|
Before launch or to stop properly
|
||||||
|
|
||||||
|
```
|
||||||
|
cd ./docker
|
||||||
|
./stop.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
if you want a linux app :
|
||||||
|
|
||||||
|
```
|
||||||
|
cd ../oc-front
|
||||||
|
./local_run_traefik.sh
|
||||||
|
```
|
||||||
|
|
||||||
# Purpose of this component
|
# Purpose of this component
|
||||||
|
|
||||||
The purpose of oc-deploy, is to deploy all the OC components over a Kubernetes cluster.
|
The purpose of oc-deploy, is to deploy all the OC components over a Kubernetes cluster.
|
||||||
|
|
||||||
An OpenCloud deployment is composed of the following layers:
|
An OpenCloud deployment is composed of the following layers:
|
||||||
|
|
||||||
|
OpenCloud components | <-- TODO
|
||||||
| Layer | Tool |
|
--------------------------
|
||||||
| ------------------------ | --------------------- |
|
KubernetesCluster | <-- TODO
|
||||||
| OpenCloud components | oc-deploy binary |
|
--------------------------
|
||||||
| KubernetesCluster | TODO or pre-requisite |
|
IaaS (VMs, LAN) | <-- pre-requisite
|
||||||
| IaaS (VMs, LAN) | pre-requisite |
|
--------------------------
|
||||||
| HW (network and servers) | <-- pre-requisite |
|
HW (network and servers) | <-- pre-requisite
|
||||||
|
--------------------------
|
||||||
|
|
||||||
|
|
||||||
It thus contains a first optional installation layer which deploys the Kubernetes nodes (control plane(s) and workers) above an existing infrastructure (Iaas).
|
It thus contains a first optional installation layer which deploys the Kubernetes nodes (control plane(s) and workers) above an existing infrastructure (Iaas).
|
||||||
|
|
||||||
|
Then the second installation layer uses Helm charts to deploy and configure all the OC components.
|
||||||
|
|
||||||
This documentation will be updated with the needed command and/or requirements to properly execute the installation.
|
This documentation will be updated with the needed command and/or requirements to properly execute the installation.
|
||||||
|
|
||||||
|
# Deploy cluster
|
||||||
# oc-deploy tools
|
## For dev in Docker
|
||||||
|
Install brew
|
||||||
## Usage
|
|
||||||
|
|
||||||
| Command | Description |
|
|
||||||
| ----------------------------------------------------------------------------- | --------------------------- |
|
|
||||||
| ```oc-deploy``` | Display help |
|
|
||||||
| ```oc-deploy version``` | Display the version of tool |
|
|
||||||
| ```oc-deploy install [-c\|--context <context>] [-v\|--version <OcVersion>]``` | Deploy an OpenCloud |
|
|
||||||
| ```oc-deploy uninstall [-c\|--context <context>]``` | Undeploy an OpenCloud |
|
|
||||||
|
|
||||||
| Arguments | Description | Default |
|
|
||||||
| ---------------- | --------------------------- | ------------ |
|
|
||||||
| ```context``` | Context Kubernetes | _opencloud_ |
|
|
||||||
| ```OcVersion``` | Specific version or latest | _latest_ |
|
|
||||||
|
|
||||||
## Principe
|
|
||||||
|
|
||||||
* Download an "OpenCloud file version" : oc_<version>.yml from relase on GitEa (core/oc-version).
|
|
||||||
* Initialise an workspace direcotry : ./workspace_<contextK8S>
|
|
||||||
* Install tools as describe, if not found on the path :
|
|
||||||
* Helm
|
|
||||||
* Kubectl
|
|
||||||
* Check if the Cluster (context) is available
|
|
||||||
* Install all charts as describe :
|
|
||||||
* Charts : from Harbor or local
|
|
||||||
* Images : from Harbor or local
|
|
||||||
* Check if componants are available
|
|
||||||
|
|
||||||
## Pre-requis
|
|
||||||
|
|
||||||
**oc-deploy** need to access to an Kubernetes Cluster, c'est-à-dire : kubeconfig.
|
|
||||||
|
|
||||||
**oc-deploy** need to access to Internet :
|
|
||||||
|
|
||||||
* to download the _oc.json_ file (contient _oc.yml_) :
|
|
||||||
* Url : https://cloud.o-forge.io/core/oc-deploy/releases
|
|
||||||
* to download _kubectl_ and _helm_ tools if
|
|
||||||
* Url : Urls are specified into _oc.yml_
|
|
||||||
|
|
||||||
## Dev
|
|
||||||
|
|
||||||
Cf. src/README.md
|
|
||||||
|
|
||||||
## Publish
|
|
||||||
|
|
||||||
Publish in the relase GitEa the binary (the binary is base64 coding).
|
|
||||||
|
|
||||||
Set **env** file to overwrite varibable as :
|
|
||||||
|
|
||||||
#!make
|
|
||||||
PUBLISH_TOKEN = <gitea_token>
|
|
||||||
|
|
||||||
To publish :
|
|
||||||
|
|
||||||
OC_VERSION = <x.y.z> make publish
|
|
||||||
|
|
||||||
# Installation on Kubernetes
|
|
||||||
|
|
||||||
## Minikube
|
|
||||||
|
|
||||||
TO DO
|
|
||||||
|
|
||||||
## Kubernetes
|
|
||||||
|
|
||||||
TO DO
|
|
||||||
|
|
||||||
## RKE2
|
|
||||||
|
|
||||||
TO DO
|
|
||||||
|
|
||||||
## OpenShift
|
|
||||||
|
|
||||||
TO DO
|
|
||||||
|
|
||||||
# Installation on Docker
|
|
||||||
|
|
||||||
Without Kubernetes, for dev in Docker
|
|
||||||
|
|
||||||
## Install brew
|
|
||||||
|
|
||||||
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
|
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
|
||||||
|
|
||||||
## Install Talos
|
Install Talos
|
||||||
|
|
||||||
brew install siderolabs/tap/talosctl
|
brew install siderolabs/tap/talosctl
|
||||||
talosctl cluster create
|
talosctl cluster create
|
||||||
## Install helm
|
# Install helm
|
||||||
curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3
|
curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3
|
||||||
chmod 700 get_helm.sh
|
chmod 700 get_helm.sh
|
||||||
./get_helm.sh
|
./get_helm.sh
|
||||||
|
|
||||||
## Create OpenCloud Chart
|
--------------------------
|
||||||
|
# Create OpenCloud Chart
|
||||||
|
|
||||||
Obsolete : use oc-deploy tool
|
# `oc-deploy` Component
|
||||||
|
|
||||||
helm create occhart
|
The `oc-deploy` component aims to simplify and automate the deployment of OpenCloud components on a Kubernetes cluster through the creation of Helm Charts.
|
||||||
|
|
||||||
|
## Prerequisites:
|
||||||
|
- Access to the OpenCloud forge and the associated Harbor registry: [https://registry.o-forge.io/](https://registry.o-forge.io/), which will allow pulling OpenCloud release images from the "stable" project.
|
||||||
|
- To test the connection to this registry from the Docker client:
|
||||||
|
```bash
|
||||||
|
docker login registry.o-forge.io
|
||||||
|
```
|
||||||
|
- A Kubernetes cluster: Minikube, K3s, RKE2, etc. See `KubernetesCluster`.
|
||||||
|
- Helm installed locally
|
||||||
|
|
||||||
|
## **To Be Defined:**
|
||||||
|
### Configuring a Docker Secret for Kubernetes
|
||||||
|
Kubernetes needs to know your credentials to pull images from the "registry.o-forge.io" registry. Create a Docker secret in Kubernetes:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
kubectl create secret docker-registry regcred \
|
||||||
|
--docker-server=registry.o-forge.io \
|
||||||
|
--docker-username=<your_username> \
|
||||||
|
--docker-password=<your_password> \
|
||||||
|
--docker-email=<your_email>
|
||||||
|
```
|
||||||
|
|
||||||
|
## Checking if Helm Recognizes Your Local Kubernetes Cluster:
|
||||||
|
|
||||||
|
### 1. Verify Connection to Kubernetes:
|
||||||
|
Before checking Helm, ensure that your `kubectl` is properly configured to connect to your local Kubernetes cluster.
|
||||||
|
Run the following command to see if you can communicate with the cluster:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
kubectl get nodes
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
If this command returns the list of nodes in your cluster, it means `kubectl` is properly connected.
|
||||||
|
|
||||||
|
### 2. Verify Helm Configuration:
|
||||||
|
Now, you can check if Helm can access the cluster by using the following command:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
helm version
|
||||||
|
```
|
||||||
|
|
||||||
|
This command displays the Helm version and the Kubernetes version it is connected to.
|
||||||
|
|
||||||
|
## Deploying with Helm:
|
||||||
|
You can deploy the `oc-deploy` Chart with Helm:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
helm install oc-deploy path/to/your/Helm/oc-deploy
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
## Checking Helm Releases:
|
||||||
|
You can also list the existing releases to see if Helm is properly connected to the cluster:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
helm list
|
||||||
|
```
|
||||||
|
|
||||||
|
If all these commands execute without errors and give the expected results, your Helm installation is correctly configured to recognize and interact with your local Kubernetes cluster
|
||||||
40
algos-demo/argo-workflow-chu.yaml
Normal file
40
algos-demo/argo-workflow-chu.yaml
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
apiVersion: argoproj.io/v1alpha1
|
||||||
|
kind: Workflow
|
||||||
|
metadata:
|
||||||
|
name: chu-pipeline
|
||||||
|
namespace: default
|
||||||
|
spec:
|
||||||
|
entrypoint: chu-steps
|
||||||
|
|
||||||
|
volumeClaimTemplates:
|
||||||
|
- metadata:
|
||||||
|
name: chu-data
|
||||||
|
spec:
|
||||||
|
accessModes: ["ReadWriteOnce"]
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 1Gi
|
||||||
|
|
||||||
|
templates:
|
||||||
|
- name: chu-steps
|
||||||
|
steps:
|
||||||
|
- - name: chu-statistics
|
||||||
|
template: chu-statistics
|
||||||
|
- - name: chu-analyzer
|
||||||
|
template: chu-analyzer
|
||||||
|
|
||||||
|
- name: chu-statistics
|
||||||
|
container:
|
||||||
|
image: opencloudregistry/chu-statistics:latest
|
||||||
|
command: ["chu-statistics"]
|
||||||
|
volumeMounts:
|
||||||
|
- name: chu-data
|
||||||
|
mountPath: /data
|
||||||
|
|
||||||
|
- name: chu-analyzer
|
||||||
|
container:
|
||||||
|
image: opencloudregistry/chu-analyzer:latest
|
||||||
|
command: ["chu-analyzer"]
|
||||||
|
volumeMounts:
|
||||||
|
- name: chu-data
|
||||||
|
mountPath: /data
|
||||||
12
algos-demo/chu-stats-analyzer/Dockerfile
Normal file
12
algos-demo/chu-stats-analyzer/Dockerfile
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
FROM golang:1.22-alpine AS builder
|
||||||
|
WORKDIR /app
|
||||||
|
COPY go.mod .
|
||||||
|
COPY main.go .
|
||||||
|
RUN go build -o chu-analyzer .
|
||||||
|
|
||||||
|
FROM alpine:latest
|
||||||
|
RUN apk --no-cache add ca-certificates tzdata
|
||||||
|
RUN mkdir -p /data
|
||||||
|
WORKDIR /app
|
||||||
|
COPY --from=builder /app/chu-analyzer /usr/local/bin/chu-analyzer
|
||||||
|
ENTRYPOINT ["chu-analyzer"]
|
||||||
3
algos-demo/chu-stats-analyzer/go.mod
Normal file
3
algos-demo/chu-stats-analyzer/go.mod
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
module chu-stats-analyzer
|
||||||
|
|
||||||
|
go 1.22
|
||||||
204
algos-demo/chu-stats-analyzer/main.go
Normal file
204
algos-demo/chu-stats-analyzer/main.go
Normal file
@@ -0,0 +1,204 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"encoding/json"
|
||||||
|
"fmt"
|
||||||
|
"log"
|
||||||
|
"math"
|
||||||
|
"os"
|
||||||
|
"strings"
|
||||||
|
"time"
|
||||||
|
)
|
||||||
|
|
||||||
|
const dataFile = "/data/chu_stats.json"
|
||||||
|
|
||||||
|
type CHUStats struct {
|
||||||
|
GeneratedAt time.Time `json:"generated_at"`
|
||||||
|
HospitalName string `json:"hospital_name"`
|
||||||
|
Date string `json:"date"`
|
||||||
|
BedsTotal int `json:"beds_total"`
|
||||||
|
BedsOccupied int `json:"beds_occupied"`
|
||||||
|
OccupancyRate float64 `json:"occupancy_rate"`
|
||||||
|
PatientsAdmitted int `json:"patients_admitted"`
|
||||||
|
PatientsDischarge int `json:"patients_discharged"`
|
||||||
|
EmergencyVisits int `json:"emergency_visits"`
|
||||||
|
AvgERWaitMinutes int `json:"avg_er_wait_minutes"`
|
||||||
|
SurgeriesPerformed int `json:"surgeries_performed"`
|
||||||
|
ICUBeds int `json:"icu_beds"`
|
||||||
|
ICUOccupied int `json:"icu_occupied"`
|
||||||
|
MortalityRate float64 `json:"mortality_rate"`
|
||||||
|
InfectionRate float64 `json:"infection_rate"`
|
||||||
|
StaffPresent int `json:"staff_present"`
|
||||||
|
StaffRequired int `json:"staff_required"`
|
||||||
|
PatientSatisfaction float64 `json:"patient_satisfaction"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type Check struct {
|
||||||
|
Indicator string `json:"indicator"`
|
||||||
|
Value float64 `json:"value"`
|
||||||
|
Unit string `json:"unit"`
|
||||||
|
Threshold string `json:"threshold"`
|
||||||
|
Conformant bool `json:"conformant"`
|
||||||
|
Severity string `json:"severity"`
|
||||||
|
Message string `json:"message"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type Analysis struct {
|
||||||
|
AnalyzedAt time.Time `json:"analyzed_at"`
|
||||||
|
HospitalName string `json:"hospital_name"`
|
||||||
|
StatsDate string `json:"stats_date"`
|
||||||
|
Conformant bool `json:"conformant"`
|
||||||
|
Score int `json:"score"`
|
||||||
|
PassingChecks int `json:"passing_checks"`
|
||||||
|
TotalChecks int `json:"total_checks"`
|
||||||
|
CriticalAlerts int `json:"critical_alerts"`
|
||||||
|
WarningAlerts int `json:"warning_alerts"`
|
||||||
|
Checks []Check `json:"checks"`
|
||||||
|
Summary string `json:"summary"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func round2(v float64) float64 {
|
||||||
|
return math.Round(v*100) / 100
|
||||||
|
}
|
||||||
|
|
||||||
|
func analyze(s CHUStats) Analysis {
|
||||||
|
var checks []Check
|
||||||
|
|
||||||
|
occ := Check{Indicator: "Taux d'occupation des lits", Value: s.OccupancyRate, Unit: "%", Threshold: "< 85%"}
|
||||||
|
switch {
|
||||||
|
case s.OccupancyRate < 85:
|
||||||
|
occ.Conformant, occ.Severity, occ.Message = true, "ok", "Taux d'occupation normal"
|
||||||
|
case s.OccupancyRate < 95:
|
||||||
|
occ.Conformant, occ.Severity, occ.Message = false, "warning", "Taux d'occupation élevé, risque de saturation"
|
||||||
|
default:
|
||||||
|
occ.Conformant, occ.Severity, occ.Message = false, "critical", "Saturation critique des lits hospitaliers"
|
||||||
|
}
|
||||||
|
checks = append(checks, occ)
|
||||||
|
|
||||||
|
er := Check{Indicator: "Temps d'attente aux urgences", Value: float64(s.AvgERWaitMinutes), Unit: "min", Threshold: "< 60 min"}
|
||||||
|
switch {
|
||||||
|
case s.AvgERWaitMinutes < 60:
|
||||||
|
er.Conformant, er.Severity, er.Message = true, "ok", "Temps d'attente aux urgences acceptable"
|
||||||
|
case s.AvgERWaitMinutes < 120:
|
||||||
|
er.Conformant, er.Severity, er.Message = false, "warning", "Temps d'attente aux urgences trop long"
|
||||||
|
default:
|
||||||
|
er.Conformant, er.Severity, er.Message = false, "critical", "Saturation critique des urgences"
|
||||||
|
}
|
||||||
|
checks = append(checks, er)
|
||||||
|
|
||||||
|
icuRate := round2(float64(s.ICUOccupied) / float64(s.ICUBeds) * 100)
|
||||||
|
icu := Check{Indicator: "Taux d'occupation ICU", Value: icuRate, Unit: "%", Threshold: "< 85%"}
|
||||||
|
switch {
|
||||||
|
case icuRate < 85:
|
||||||
|
icu.Conformant, icu.Severity, icu.Message = true, "ok", "Capacité de réanimation suffisante"
|
||||||
|
case icuRate < 95:
|
||||||
|
icu.Conformant, icu.Severity, icu.Message = false, "warning", "Taux d'occupation ICU élevé"
|
||||||
|
default:
|
||||||
|
icu.Conformant, icu.Severity, icu.Message = false, "critical", "Réanimation en situation critique"
|
||||||
|
}
|
||||||
|
checks = append(checks, icu)
|
||||||
|
|
||||||
|
mort := Check{Indicator: "Taux de mortalité hospitalière", Value: s.MortalityRate, Unit: "%", Threshold: "< 2%"}
|
||||||
|
switch {
|
||||||
|
case s.MortalityRate < 2.0:
|
||||||
|
mort.Conformant, mort.Severity, mort.Message = true, "ok", "Taux de mortalité dans les normes"
|
||||||
|
case s.MortalityRate < 4.0:
|
||||||
|
mort.Conformant, mort.Severity, mort.Message = false, "warning", "Taux de mortalité supérieur au seuil recommandé"
|
||||||
|
default:
|
||||||
|
mort.Conformant, mort.Severity, mort.Message = false, "critical", "Taux de mortalité critique — investigation requise"
|
||||||
|
}
|
||||||
|
checks = append(checks, mort)
|
||||||
|
|
||||||
|
infect := Check{Indicator: "Taux d'infection nosocomiale", Value: s.InfectionRate, Unit: "%", Threshold: "< 5%"}
|
||||||
|
switch {
|
||||||
|
case s.InfectionRate < 5.0:
|
||||||
|
infect.Conformant, infect.Severity, infect.Message = true, "ok", "Taux d'infection nosocomiale acceptable"
|
||||||
|
case s.InfectionRate < 8.0:
|
||||||
|
infect.Conformant, infect.Severity, infect.Message = false, "warning", "Taux d'infection nosocomiale préoccupant"
|
||||||
|
default:
|
||||||
|
infect.Conformant, infect.Severity, infect.Message = false, "critical", "Risque infectieux critique — mesures d'urgence requises"
|
||||||
|
}
|
||||||
|
checks = append(checks, infect)
|
||||||
|
|
||||||
|
staffRate := round2(float64(s.StaffPresent) / float64(s.StaffRequired) * 100)
|
||||||
|
staff := Check{Indicator: "Taux de couverture du personnel", Value: staffRate, Unit: "%", Threshold: ">= 80%"}
|
||||||
|
switch {
|
||||||
|
case staffRate >= 80:
|
||||||
|
staff.Conformant, staff.Severity, staff.Message = true, "ok", "Personnel suffisant"
|
||||||
|
case staffRate >= 70:
|
||||||
|
staff.Conformant, staff.Severity, staff.Message = false, "warning", "Manque de personnel, vigilance requise"
|
||||||
|
default:
|
||||||
|
staff.Conformant, staff.Severity, staff.Message = false, "critical", "Sous-effectif critique"
|
||||||
|
}
|
||||||
|
checks = append(checks, staff)
|
||||||
|
|
||||||
|
sat := Check{Indicator: "Satisfaction des patients", Value: s.PatientSatisfaction, Unit: "/ 5", Threshold: ">= 3.5 / 5"}
|
||||||
|
switch {
|
||||||
|
case s.PatientSatisfaction >= 3.5:
|
||||||
|
sat.Conformant, sat.Severity, sat.Message = true, "ok", "Satisfaction des patients satisfaisante"
|
||||||
|
case s.PatientSatisfaction >= 3.0:
|
||||||
|
sat.Conformant, sat.Severity, sat.Message = false, "warning", "Satisfaction des patients insuffisante"
|
||||||
|
default:
|
||||||
|
sat.Conformant, sat.Severity, sat.Message = false, "critical", "Satisfaction des patients très mauvaise"
|
||||||
|
}
|
||||||
|
checks = append(checks, sat)
|
||||||
|
|
||||||
|
passing, critical, warning := 0, 0, 0
|
||||||
|
for _, c := range checks {
|
||||||
|
if c.Conformant {
|
||||||
|
passing++
|
||||||
|
}
|
||||||
|
switch c.Severity {
|
||||||
|
case "critical":
|
||||||
|
critical++
|
||||||
|
case "warning":
|
||||||
|
warning++
|
||||||
|
}
|
||||||
|
}
|
||||||
|
total := len(checks)
|
||||||
|
score := passing * 100 / total
|
||||||
|
|
||||||
|
return Analysis{
|
||||||
|
AnalyzedAt: time.Now().UTC(),
|
||||||
|
HospitalName: s.HospitalName,
|
||||||
|
StatsDate: s.Date,
|
||||||
|
Conformant: passing == total,
|
||||||
|
Score: score,
|
||||||
|
PassingChecks: passing,
|
||||||
|
TotalChecks: total,
|
||||||
|
CriticalAlerts: critical,
|
||||||
|
WarningAlerts: warning,
|
||||||
|
Checks: checks,
|
||||||
|
Summary: fmt.Sprintf(
|
||||||
|
"%d/%d indicateurs conformes (score: %d%%) — %d alerte(s) critique(s), %d avertissement(s)",
|
||||||
|
passing, total, score, critical, warning,
|
||||||
|
),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
for i := range []int{0, 1} {
|
||||||
|
data, err := os.ReadFile(strings.ReplaceAll(dataFile, "stats", "stats"+fmt.Sprintf("%v", i)))
|
||||||
|
if err != nil {
|
||||||
|
if os.IsNotExist(err) {
|
||||||
|
log.Fatalf("stats file not found at %s — run chu-stats-generator first", dataFile)
|
||||||
|
}
|
||||||
|
log.Fatalf("failed to read stats file: %v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
var stats CHUStats
|
||||||
|
if err := json.Unmarshal(data, &stats); err != nil {
|
||||||
|
log.Fatalf("failed to parse stats file: %v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
analysis := analyze(stats)
|
||||||
|
|
||||||
|
result, err := json.MarshalIndent(analysis, "", " ")
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to marshal analysis: %v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
log.Printf("Analysis complete: %s", analysis.Summary)
|
||||||
|
fmt.Println(string(result))
|
||||||
|
}
|
||||||
|
}
|
||||||
12
algos-demo/chu-stats-generator/Dockerfile
Normal file
12
algos-demo/chu-stats-generator/Dockerfile
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
FROM golang:1.22-alpine AS builder
|
||||||
|
WORKDIR /app
|
||||||
|
COPY go.mod .
|
||||||
|
COPY main.go .
|
||||||
|
RUN go build -o chu-statistics .
|
||||||
|
|
||||||
|
FROM alpine:latest
|
||||||
|
RUN apk --no-cache add ca-certificates tzdata
|
||||||
|
RUN mkdir -p /data
|
||||||
|
WORKDIR /app
|
||||||
|
COPY --from=builder /app/chu-statistics /usr/local/bin/chu-statistics
|
||||||
|
ENTRYPOINT ["chu-statistics"]
|
||||||
3
algos-demo/chu-stats-generator/go.mod
Normal file
3
algos-demo/chu-stats-generator/go.mod
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
module chu-stats-generator
|
||||||
|
|
||||||
|
go 1.22
|
||||||
96
algos-demo/chu-stats-generator/main.go
Normal file
96
algos-demo/chu-stats-generator/main.go
Normal file
@@ -0,0 +1,96 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"encoding/json"
|
||||||
|
"fmt"
|
||||||
|
"log"
|
||||||
|
"math"
|
||||||
|
"math/rand"
|
||||||
|
"os"
|
||||||
|
"strings"
|
||||||
|
"time"
|
||||||
|
)
|
||||||
|
|
||||||
|
const dataFile = "/data/chu_stats.json"
|
||||||
|
|
||||||
|
type CHUStats struct {
|
||||||
|
GeneratedAt time.Time `json:"generated_at"`
|
||||||
|
HospitalName string `json:"hospital_name"`
|
||||||
|
Date string `json:"date"`
|
||||||
|
BedsTotal int `json:"beds_total"`
|
||||||
|
BedsOccupied int `json:"beds_occupied"`
|
||||||
|
OccupancyRate float64 `json:"occupancy_rate"`
|
||||||
|
PatientsAdmitted int `json:"patients_admitted"`
|
||||||
|
PatientsDischarge int `json:"patients_discharged"`
|
||||||
|
EmergencyVisits int `json:"emergency_visits"`
|
||||||
|
AvgERWaitMinutes int `json:"avg_er_wait_minutes"`
|
||||||
|
SurgeriesPerformed int `json:"surgeries_performed"`
|
||||||
|
ICUBeds int `json:"icu_beds"`
|
||||||
|
ICUOccupied int `json:"icu_occupied"`
|
||||||
|
MortalityRate float64 `json:"mortality_rate"`
|
||||||
|
InfectionRate float64 `json:"infection_rate"`
|
||||||
|
StaffPresent int `json:"staff_present"`
|
||||||
|
StaffRequired int `json:"staff_required"`
|
||||||
|
PatientSatisfaction float64 `json:"patient_satisfaction"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func round2(v float64) float64 {
|
||||||
|
return math.Round(v*100) / 100
|
||||||
|
}
|
||||||
|
|
||||||
|
func generateStats() CHUStats {
|
||||||
|
rng := rand.New(rand.NewSource(time.Now().UnixNano()))
|
||||||
|
|
||||||
|
bedsTotal := 800 + rng.Intn(400)
|
||||||
|
occupancyPct := 0.65 + rng.Float64()*0.32
|
||||||
|
bedsOccupied := int(float64(bedsTotal) * occupancyPct)
|
||||||
|
|
||||||
|
icuBeds := 40 + rng.Intn(30)
|
||||||
|
icuOccupancyPct := 0.60 + rng.Float64()*0.38
|
||||||
|
icuOccupied := int(float64(icuBeds) * icuOccupancyPct)
|
||||||
|
|
||||||
|
staffRequired := 600 + rng.Intn(300)
|
||||||
|
staffCoverage := 0.65 + rng.Float64()*0.40
|
||||||
|
staffPresent := int(float64(staffRequired) * staffCoverage)
|
||||||
|
|
||||||
|
return CHUStats{
|
||||||
|
GeneratedAt: time.Now().UTC(),
|
||||||
|
HospitalName: "CHU Demo",
|
||||||
|
Date: time.Now().Format("2006-01-02"),
|
||||||
|
BedsTotal: bedsTotal,
|
||||||
|
BedsOccupied: bedsOccupied,
|
||||||
|
OccupancyRate: round2(occupancyPct * 100),
|
||||||
|
PatientsAdmitted: 50 + rng.Intn(120),
|
||||||
|
PatientsDischarge: 40 + rng.Intn(120),
|
||||||
|
EmergencyVisits: 80 + rng.Intn(150),
|
||||||
|
AvgERWaitMinutes: 15 + rng.Intn(130),
|
||||||
|
SurgeriesPerformed: 10 + rng.Intn(50),
|
||||||
|
ICUBeds: icuBeds,
|
||||||
|
ICUOccupied: icuOccupied,
|
||||||
|
MortalityRate: round2(0.3 + rng.Float64()*4.5),
|
||||||
|
InfectionRate: round2(0.5 + rng.Float64()*9.0),
|
||||||
|
StaffPresent: staffPresent,
|
||||||
|
StaffRequired: staffRequired,
|
||||||
|
PatientSatisfaction: round2(2.0 + rng.Float64()*3.0),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
for i, stats := range []CHUStats{generateStats(), generateStats()} {
|
||||||
|
data, err := json.MarshalIndent(stats, "", " ")
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed to marshal stats: %v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := os.MkdirAll("/data", 0755); err != nil {
|
||||||
|
log.Fatalf("failed to create data dir: %v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := os.WriteFile(strings.ReplaceAll(dataFile, "stats", "stats"+fmt.Sprintf("%v", i)), data, 0644); err != nil {
|
||||||
|
log.Fatalf("failed to write stats file: %v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
log.Printf("Stats saved to %s", dataFile)
|
||||||
|
fmt.Println(string(data))
|
||||||
|
}
|
||||||
|
}
|
||||||
22
datas/add.sh
Normal file
22
datas/add.sh
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
DB="DC_myDC"
|
||||||
|
CONTAINER="mongo"
|
||||||
|
|
||||||
|
echo "📌 Dropping database '$DB'..."
|
||||||
|
docker exec -i $CONTAINER mongosh --eval "db.getSiblingDB('$DB').dropDatabase()"
|
||||||
|
|
||||||
|
echo "📌 Copying datas/ to container..."
|
||||||
|
docker cp ./datas $CONTAINER:/datas
|
||||||
|
|
||||||
|
echo "📌 Importing JSON files..."
|
||||||
|
for i in ./datas/*.json; do
|
||||||
|
filename=$(basename "$i")
|
||||||
|
collection="${filename%.json}"
|
||||||
|
|
||||||
|
echo "→ Importing '$filename' into collection '$collection'..."
|
||||||
|
docker exec -i $CONTAINER sh -c \
|
||||||
|
"mongoimport --jsonArray --db $DB --collection $collection --file /datas/$filename --drop"
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "✔ Done!"
|
||||||
1
datas/demo-alpr/collaborative_area.json
Normal file
1
datas/demo-alpr/collaborative_area.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
[{"_id":"0b6a375f-be3e-49a9-9827-3c2d5eddb057","abstractobject":{"id":"0b6a375f-be3e-49a9-9827-3c2d5eddb057","name":"test","is_draft":false,"creator_id":"c0cece97-7730-4c2a-8c20-a30944564106","creation_date":{"$date":"2025-01-27T10:41:47.741Z"},"update_date":{"$date":"2025-01-27T10:41:47.741Z"},"updater_id":"c0cece97-7730-4c2a-8c20-a30944564106","access_mode":0},"description":"Proto Collaborative area example","collaborative_area":{},"workflows":["58314c99-c595-4ca2-8b5e-822a6774efed"],"allowed_peers_group":{"c0cece97-7730-4c2a-8c20-a30944564106":["*"]},"workspaces":[]}]
|
||||||
1
datas/demo-alpr/compute_resource.json
Normal file
1
datas/demo-alpr/compute_resource.json
Normal file
File diff suppressed because one or more lines are too long
1
datas/demo-alpr/data_resource.json
Normal file
1
datas/demo-alpr/data_resource.json
Normal file
File diff suppressed because one or more lines are too long
1
datas/demo-alpr/peer.json
Normal file
1
datas/demo-alpr/peer.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
[{"_id":"c0cece97-7730-4c2a-8c20-a30944564106","failed_execution":null,"abstractobject":{"update_date":{"$date":"2025-03-27T09:13:13.230Z"},"access_mode":0,"id":"c0cece97-7730-4c2a-8c20-a30944564106","name":"local","is_draft":false,"creation_date":{"$date":"2025-03-27T09:13:13.230Z"}},"url":"http://localhost:8000","wallet_address":"my-wallet","public_key":"-----BEGIN RSA PUBLIC KEY-----\nMIICCgKCAgEAw2pdG6wMtuLcP0+k1LFvIb0DQo/oHW2uNJaEJK74plXqp4ztz2dR\nb+RQHFLeLuqk4i/zc3b4K3fKPXSlwnVPJCwzPrnyT8jYGOZVlWlETiV9xeJhu6s/\nBh6g1PWz75XjjwV50iv/CEiLNBT23f/3J44wrQzygqNQCiQSALdxWLAEl4l5kHSa\n9oMyV70/Uql94/ayMARZsHgp9ZvqQKbkZPw6yzVMfCBxQozlNlo315OHevudhnhp\nDRjN5I7zWmqYt6rbXJJC7Y3Izdvzn7QI88RqjSRST5I/7Kz3ndCqrOnI+OQUE5NT\nREyQebphvQfTDTKlRPXkdyktdK2DH28Zj6ZF3yjQvN35Q4zhOzlq77dO5IhhopI7\nct8dZH1T1nYkvdyCA/EVMtQsASmBOitH0Y0ACoXQK5Kb6nm/TcM/9ZSJUNiEMuy5\ngBZ3YKE9oa4cpTpPXwcA+S/cU7HPNnQAsvD3iJi8GTW9uJs84pn4/WhpQqmXd4rv\nhKWECCN3fHy01fUs/U0PaSj2jDY/kQVeXoikNMzPUjdZd9m816TIBh3v3aVXCH/0\niTHHAxctvDgMRb2fpvRJ/wwnYjFG9RpamVFDMvC9NffuYzWAA9IRIY4cqgerfHrV\nZ2HHiPTDDvDAIsvImXZc/h7mXN6m3RCQ4Qywy993wd9gUdgg/qnynHcCAwEAAQ==\n-----END RSA PUBLIC KEY-----\n","state":1}]
|
||||||
1
datas/demo-alpr/processing_resource.json
Normal file
1
datas/demo-alpr/processing_resource.json
Normal file
File diff suppressed because one or more lines are too long
1
datas/demo-alpr/storage_resource.json
Normal file
1
datas/demo-alpr/storage_resource.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
[{"_id":"04bc70b5-8d7b-44e6-9015-fadfa0fb102d","abstractinstanciatedresource":{"abstractresource":{"type":"storage","abstractobject":{"id":"04bc70b5-8d7b-44e6-9015-fadfa0fb102d","name":"IRT risk database","is_draft":false,"creator_id":"c0cece97-7730-4c2a-8c20-a30944564106","creation_date":"2021-09-30T14:00:00.000Z","update_date":"2021-09-30T14:00:00.000Z","updater_id":"c0cece97-7730-4c2a-8c20-a30944564106","access_mode":1},"logo":"https://cloud.o-forge.io/core/deperecated-oc-catalog/raw/branch/main/scripts/local_imgs/IRT risk database.png","description":"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.","short_description":"S3 compliant IRT file storage","owners":[{"name":"IRT"}]},"instances":[{"env":[{"attr":"source","readonly":true}],"resourceinstance":{"abstractobject":{"id":"7fdccb9c-7090-40a5-bacd-7435bc56c90d","name":"IRT local file storage Marseille"},"location":{"latitude":50.62925,"longitude":3.057256},"country":250,"partnerships":[{"resourcepartnership":{"namespace":"default","peer_groups":{"c0cece97-7730-4c2a-8c20-a30944564106":["*"]},"pricing_profiles":[{"pricing":{"price":50,"currency":"EUR","buying_strategy":0,"time_pricing_strategy":0}}]}}]},"source":"/mnt/vol","local":false,"security_level":"public","size":50,"size_type":3,"redundancy":"RAID5","throughput":"r:200,w:150"}]},"storage_type":5,"acronym":"DC_myDC"},{"_id":"e726020a-b68e-4abc-ab36-c3640ea3f557","abstractinstanciatedresource":{"abstractresource":{"type":"storage","abstractobject":{"id":"e726020a-b68e-4abc-ab36-c3640ea3f557","name":"IRT local file storage","is_draft":false,"creator_id":"c0cece97-7730-4c2a-8c20-a30944564106","creation_date":"2021-09-30T14:00:00.000Z","update_date":"2021-09-30T14:00:00.000Z","updater_id":"c0cece97-7730-4c2a-8c20-a30944564106","access_mode":1},"logo":"https://cloud.o-forge.io/core/deperecated-oc-catalog/raw/branch/main/scripts/local_imgs/IRT local file storage.png","description":"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.","short_description":"S3 compliant IRT file storage","owners":[{"name":"IRT"}]},"instances":[{"resourceinstance":{"env":[{"attr":"source","readonly":true}],"abstractobject":{"id":"7fdccb9c-7090-40a5-bacd-7435bc56c90d","name":"IRT local file storage Marseille"},"location":{"latitude":50.62925,"longitude":3.057256},"country":250,"partnerships":[{"resourcepartnership":{"namespace":"default","peer_groups":{"c0cece97-7730-4c2a-8c20-a30944564106":["*"]},"pricing_profiles":[{"pricing":{"price":50,"currency":"EUR","buying_strategy":0,"time_pricing_strategy":0}}]}}]},"source":"/mnt/vol","local":true,"security_level":"public","size":500,"size_type":0,"encryption":true,"redundancy":"RAID5S","throughput":"r:300,w:350"}]},"storage_type":5,"acronym":"DC_myDC"}]
|
||||||
1
datas/demo-alpr/workflow.json
Normal file
1
datas/demo-alpr/workflow.json
Normal file
File diff suppressed because one or more lines are too long
19
deployed_config
Normal file
19
deployed_config
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
clusters:
|
||||||
|
- cluster:
|
||||||
|
certificate-authority-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURCVENDQWUyZ0F3SUJBZ0lJT0lhTzFqdnRET0F3RFFZSktvWklodmNOQVFFTEJRQXdGVEVUTUJFR0ExVUUKQXhNS2EzVmlaWEp1WlhSbGN6QWVGdzB5TlRFeE1UTXhNVFU0TVRaYUZ3MHpOVEV4TVRFeE1qQXpNVFphTUJVeApFekFSQmdOVkJBTVRDbXQxWW1WeWJtVjBaWE13Z2dFaU1BMEdDU3FHU0liM0RRRUJBUVVBQTRJQkR3QXdnZ0VLCkFvSUJBUUNsVGxkUEozTkpON0wyblVtbDFLM3pNL21PV3VLN0FKZzBjNktJY01nZFhoaEF3Z0FPRzFuUnZhRG8KL3N3ODBweUFjbEJSbzg2bnlyM1d6UUVYa1hTTDY2bFV6LzJzaHh5QlliejJXTDlZeUZGVmxwSzlPY3BRQjVIegpURUNrNStIY28rK1NJVndXUHc0dCtQZXhsb2VpaHZhUUJvUE54d2lxWjhhWG50NUljd0lXU1ZqMVVsT1p1NmhwCnA3VUVuS0dhTWl3Zm5Zb2o4MmNvUVFEdFlEWi9MQS80L3V1UzVlUFZKaTBpb1dXMGduTWdzUm1IUzltY3cvZzkKK1hYVm5vN1lLekYvRjEyeTZPQ0YrOUpGd2JqWmFiVlJhc21rQjZyTFZ1N2FsMi9TQ3VyaitEWk5Mcys5WHVTYgpFb2I2UE8rQlhlNmJDdGp5aWZvZmJ2TExXREc5QWdNQkFBR2pXVEJYTUE0R0ExVWREd0VCL3dRRUF3SUNwREFQCkJnTlZIUk1CQWY4RUJUQURBUUgvTUIwR0ExVWREZ1FXQkJTd2oyczRpUG9rV0FnSFlNQ1czZ2NxMEEzNlZ6QVYKQmdOVkhSRUVEakFNZ2dwcmRXSmxjbTVsZEdWek1BMEdDU3FHU0liM0RRRUJDd1VBQTRJQkFRQWc3ZW9BTWRlZgpwN21IYVFnR1F2YnRQRHVQY2REa2J1NjVKWDI2ZzhNMy9WMlovaEp4MlpqVE0wdTZmNExuOUFnc1p0R3dhL1RRClp0aGRpQWdWdDRuNjZBZ1lLQS8yYlNBbVNWZ1R0cngyd29xN2VzbnJjc1VUcm5ISXptVS9TR01CVzNtTlZnd0sKWnpLN3ZuTm9jaHAzYzNDa0xmbWFXeWpMUjljVXVWejB0T3psa0p5SDB6OUNrQVVXdmVJZ3VTR2Y2WWtManRPZQpvdld3ZHJUcTlLaGQ2SEVXa0lIM241QjNDbTF0aXE0bGFuaVJERkhheWk1enRBSDBYME1UOUhaNGszR0ErdXA4CkZJZXdubDJXTmJoVGxraXdhMzRRTUhDelhpUXdGTThjODUwTnJGNXFOSEVTbUMzeWtGdjk3VlNqOW8wb3pPS3YKSWlERkRVSTZybG0rCi0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K
|
||||||
|
server: https://127.0.0.1:36289
|
||||||
|
name: kind-opencloud
|
||||||
|
contexts:
|
||||||
|
- context:
|
||||||
|
cluster: kind-opencloud
|
||||||
|
user: kind-opencloud
|
||||||
|
name: kind-opencloud
|
||||||
|
current-context: kind-opencloud
|
||||||
|
kind: Config
|
||||||
|
users:
|
||||||
|
- name: kind-opencloud
|
||||||
|
user:
|
||||||
|
client-certificate-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURLVENDQWhHZ0F3SUJBZ0lJVnpzcEVlN3Z2eFF3RFFZSktvWklodmNOQVFFTEJRQXdGVEVUTUJFR0ExVUUKQXhNS2EzVmlaWEp1WlhSbGN6QWVGdzB5TlRFeE1UTXhNVFU0TVRaYUZ3MHlOakV4TVRNeE1qQXpNVFphTUR3eApIekFkQmdOVkJBb1RGbXQxWW1WaFpHMDZZMngxYzNSbGNpMWhaRzFwYm5NeEdUQVhCZ05WQkFNVEVHdDFZbVZ5CmJtVjBaWE10WVdSdGFXNHdnZ0VpTUEwR0NTcUdTSWIzRFFFQkFRVUFBNElCRHdBd2dnRUtBb0lCQVFEV2s3YlkKYWVYQjJGaUczSjc1Zk5iaGkxQkhkTTdrNk8yQ0p1WkJydzE0UldSNWZ2YnZUNHVBRm1LZ0VFWHk0angvaWdwOQpFUm9QUmFxUFoxQSs0N21HRUl0bjdSdFFuY0k2N3FMSUxnUUU4ZkhWTE9GU0hVRmV0S05tbGxZNEErWDVRejZmCjBHdExBZzNoMlc4bmtibGtzakNVQjR3SEF5ZnMrM1dtZmJRb0YzcmU5NUlKMDZCY2NtOTgyZTFVUUpsZ1YzaW4KN0pQdlRDYmp0bkR1UmV4VXpyazJsK1JHWjVHYitaZEs3Z1QvS2MvdFhONjVIYTRiTHc2aFR4RzdxZlB5dnlSdAphblVYcHQ5SVNSd3BPc2R6YjF1RkZTYUN6V1FBWUNJc3RpeWs1bkszVWJwL1ZLS2trTFlub2NVbjdKNUtOdDJFCjhTcTZ1N2RjRWNqZFBaUWhBZ01CQUFHalZqQlVNQTRHQTFVZER3RUIvd1FFQXdJRm9EQVRCZ05WSFNVRUREQUsKQmdnckJnRUZCUWNEQWpBTUJnTlZIUk1CQWY4RUFqQUFNQjhHQTFVZEl3UVlNQmFBRkxDUGF6aUkraVJZQ0FkZwp3SmJlQnlyUURmcFhNQTBHQ1NxR1NJYjNEUUVCQ3dVQUE0SUJBUUJjSUEyeE9rYXk4aTlLS3pRWUh5bmM5a2xyCmU4ZEN1aHpEUWhGbVhYK3pmeTk3dnRaSnlEWFp4TlN0MlRoS24xeE5KckNKVkxPWTAxV0FDU2JNZm5wRGdxVjgKUWZjRXVFUHdYSithMUV0ZmpsajZPTU41Q0RvYWJnRUllSkhxVkhrZkJzdE5icXFrTEppUThvZmh2VDc4TE1Bcwp2emJNTnd5L0ZXOVBVK0YvUGJkOEdEZkVPWHU3UFJzbmV5Q0JHVXhoNThOM2lmNFhnOXh6L3hwM2EvNE1hK28vClc2RklOUUNkNjVzcVFSWEx1U3VpRjlTTG9peUtYdmJUb1UxNU9YZTNOWFNWTjNOdUdRWmlZWDU4OTFyZGtpZFIKL1NuN3VTTzJDWXNPK3l4QWlqbUZhQmZIeWpNUlZKak51WnpSbStwTDdoODFmNFQ5dDJ1MWpQeVpPbGRiCi0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K
|
||||||
|
client-key-data: LS0tLS1CRUdJTiBSU0EgUFJJVkFURSBLRVktLS0tLQpNSUlFcFFJQkFBS0NBUUVBMXBPMjJHbmx3ZGhZaHR5ZStYelc0WXRRUjNUTzVPanRnaWJtUWE4TmVFVmtlWDcyCjcwK0xnQlppb0JCRjh1SThmNG9LZlJFYUQwV3FqMmRRUHVPNWhoQ0xaKzBiVUozQ091Nml5QzRFQlBIeDFTemgKVWgxQlhyU2pacFpXT0FQbCtVTStuOUJyU3dJTjRkbHZKNUc1WkxJd2xBZU1Cd01uN1B0MXBuMjBLQmQ2M3ZlUwpDZE9nWEhKdmZObnRWRUNaWUZkNHAreVQ3MHdtNDdadzdrWHNWTTY1TnBma1JtZVJtL21YU3U0RS95blA3VnplCnVSMnVHeThPb1U4UnU2bno4cjhrYldwMUY2YmZTRWtjS1RySGMyOWJoUlVtZ3Mxa0FHQWlMTFlzcE9aeXQxRzYKZjFTaXBKQzJKNkhGSit5ZVNqYmRoUEVxdXJ1M1hCSEkzVDJVSVFJREFRQUJBb0lCQUFkSElhWldkU29DMEt5RwpVc2dMTEJpZ245dVo3U013enFRaG9LRllDQ0RDV0hBOGdRWHpPenZnRzlQcVZBMElaUWZvWW9jRkZrNnY5Mk1xCkhHWjlxbjhQRkVOZjlKTmlrOElVUjZZbGdCSm1NdzhldzJldkZxd0QwWFQ3SXJmVXFLOWJKZ1p5b2I1U0RBUW8KaFU5MkdhL1RmQTFSUjR1OHJOVXFDWlFEamN3OFFSQTQ4SDBzOTJkU252QkN1SmJrQ0VIYXVtQTYwQVlsNHNMOApzS0o0NytFc29WTWZhK1dCOCsybnRYMHFqQlhLM1Yvc1UyZWJTN0tYTGZhVkg5Z21oU01LMFd2dG9peDRRQzlEClViV3RaTCtoSGN6WWxmcjZaYWQxeEFsaHRXYnNDS3p3ZWdjOGxQbVBqSUJmMUU0bjRDQW1OMmJ5R00wUlRrT1QKWHdvdWdEOENnWUVBNGVISWQ0Zy9FV3k0dmx0NGxUN2FnOFJKaVhxMHBOQXVDdTRBL25tVWpnTVVVcFFPbmd6cAora3d6ZjFNSUJnVGR0ejlHNU1zNmd6UHgxaTlYblVOZ1hEUlRuWTRSZkZ3Q256NXVNcW5LZDd3Njhwem9acUxGCjJpSVZ6SmtGUmVoaTNVbXVLWnJmRnJKekYrOFArMGtmZmpjNjcvZkF1c2pnellFbWl5dGxmQnNDZ1lFQTh6QU0KdUh3VG1WMC9aRFlyUUYxLzA2R1ZqbzRtT2Z4S0loUVBxdDZleVNuWElySGlBbUVnTjFOWTc1UHRtMGVVdXF0bApDanU4dmp4aHd0UUF6NnUwNEptTldpTzdZL0ZiYlVKNnAxcHJYaURVWXYvUkRwK3FHa1I1SExsd0gvWENrYzIxCnpnREhJMlVXMzZCUk4wMFhydjdGWThxaHNqU0dlZU1Gei9pNXZITUNnWUVBcDhJSklZVmwyYW9XZHdIMlIxbWIKN2xxOGhzZEVIRmVrcW1kakE1d0dVWVpGOUtLVFRKeW90VVVjeGdaRG9qekE4ZFNqOFU1aVVZa2xwZjRaSXVvawpTYlp2RjBlcEF1Uk82amZ5bmR2dVRBalcrdEsvNDJJbWNULzVVcStlOC9HSVkzTFNUNEgvQjV0VzBVS3lhdDArCjczMVRYMTl3bXdpUHRQQ2pVSjdWUzFzQ2dZRUF3NWthSWlocCt5aXRIQVVWdEtkL2NOQytZZktqZkhBWGtHRmkKV0tUR1FqYU0rekxuL2RIdy80N2lNWkJoeEV0R3JQMitQd1RkUW9WK2ZCM1lxVEFLUTd3OW5RcXdaaXB5eHVaNQprTEdCT2l4ZHAyTHEyMEJBcU8vNkdjaHREc2UwdjJFZG9adXVrQ0YyekZjOSs2VGVMN3ByT1dCNXZjUFJoYWU3CnZSTHBFVkVDZ1lFQXAyREYyWlJFRlZmZ3ZGc2dtdHRwVjFMemd2Qi9Fb0lFMTFpMmFPelZGTzRLb3pabWpHVlAKaTB6T3VlaVBsZmNCYU5ZanRIbkxrRUpYeGVwYm9sSnlvQUdWV0o2b2grcFhON2I5TURJVUhVV0E3ZFArc1NlMwpvS29adS9TVGdJa1VQb2xwa2lJNjJrRXBFdXE4bjRYOFVhUWV5M1E4c1VWNHpYM0dSa3d2QkFZPQotLS0tLUVORCBSU0EgUFJJVkFURSBLRVktLS0tLQo=
|
||||||
|
|
||||||
9
docker/db/add.sh
Executable file
9
docker/db/add.sh
Executable file
@@ -0,0 +1,9 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
docker cp ./datas mongo:.
|
||||||
|
|
||||||
|
for i in $(ls ./datas); do
|
||||||
|
firstString=$i
|
||||||
|
echo "ADD file $i in collection ${i/.json/}"
|
||||||
|
docker exec -it mongo sh -c "mongoimport --jsonArray --db DC_myDC --collection ${i/.json/} --file ./datas/$i"
|
||||||
|
done
|
||||||
1
docker/db/datas/collaborative_area.json
Normal file
1
docker/db/datas/collaborative_area.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
[{"_id":"0b6a375f-be3e-49a9-9827-3c2d5eddb057","abstractobject":{"id":"0b6a375f-be3e-49a9-9827-3c2d5eddb057","name":"test","is_draft":false,"creator_id":"c0cece97-7730-4c2a-8c20-a30944564106","creation_date":{"$date":"2025-01-27T10:41:47.741Z"},"update_date":{"$date":"2025-01-27T10:41:47.741Z"},"updater_id":"c0cece97-7730-4c2a-8c20-a30944564106","access_mode":0},"description":"Proto Collaborative area example","collaborative_area":{},"workflows":["58314c99-c595-4ca2-8b5e-822a6774efed"],"allowed_peers_group":{"c0cece97-7730-4c2a-8c20-a30944564106":["*"]},"workspaces":[]}]
|
||||||
1
docker/db/datas/compute_resource.json
Normal file
1
docker/db/datas/compute_resource.json
Normal file
File diff suppressed because one or more lines are too long
1
docker/db/datas/data_resource.json
Normal file
1
docker/db/datas/data_resource.json
Normal file
File diff suppressed because one or more lines are too long
1
docker/db/datas/peer.json
Normal file
1
docker/db/datas/peer.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
[{"_id":"c0cece97-7730-4c2a-8c20-a30944564106","failed_execution":null,"abstractobject":{"update_date":{"$date":"2025-03-27T09:13:13.230Z"},"access_mode":0,"id":"c0cece97-7730-4c2a-8c20-a30944564106","name":"local","is_draft":false,"creation_date":{"$date":"2025-03-27T09:13:13.230Z"}},"url":"http://localhost:8000","wallet_address":"my-wallet","public_key":"-----BEGIN RSA PUBLIC KEY-----\nMIICCgKCAgEAw2pdG6wMtuLcP0+k1LFvIb0DQo/oHW2uNJaEJK74plXqp4ztz2dR\nb+RQHFLeLuqk4i/zc3b4K3fKPXSlwnVPJCwzPrnyT8jYGOZVlWlETiV9xeJhu6s/\nBh6g1PWz75XjjwV50iv/CEiLNBT23f/3J44wrQzygqNQCiQSALdxWLAEl4l5kHSa\n9oMyV70/Uql94/ayMARZsHgp9ZvqQKbkZPw6yzVMfCBxQozlNlo315OHevudhnhp\nDRjN5I7zWmqYt6rbXJJC7Y3Izdvzn7QI88RqjSRST5I/7Kz3ndCqrOnI+OQUE5NT\nREyQebphvQfTDTKlRPXkdyktdK2DH28Zj6ZF3yjQvN35Q4zhOzlq77dO5IhhopI7\nct8dZH1T1nYkvdyCA/EVMtQsASmBOitH0Y0ACoXQK5Kb6nm/TcM/9ZSJUNiEMuy5\ngBZ3YKE9oa4cpTpPXwcA+S/cU7HPNnQAsvD3iJi8GTW9uJs84pn4/WhpQqmXd4rv\nhKWECCN3fHy01fUs/U0PaSj2jDY/kQVeXoikNMzPUjdZd9m816TIBh3v3aVXCH/0\niTHHAxctvDgMRb2fpvRJ/wwnYjFG9RpamVFDMvC9NffuYzWAA9IRIY4cqgerfHrV\nZ2HHiPTDDvDAIsvImXZc/h7mXN6m3RCQ4Qywy993wd9gUdgg/qnynHcCAwEAAQ==\n-----END RSA PUBLIC KEY-----\n","state":1}]
|
||||||
1
docker/db/datas/processing_resource.json
Normal file
1
docker/db/datas/processing_resource.json
Normal file
File diff suppressed because one or more lines are too long
1
docker/db/datas/storage_resource.json
Normal file
1
docker/db/datas/storage_resource.json
Normal file
File diff suppressed because one or more lines are too long
1
docker/db/datas/workflow.json
Normal file
1
docker/db/datas/workflow.json
Normal file
File diff suppressed because one or more lines are too long
1
docker/db/datas_alpr/collaborative_area.json
Normal file
1
docker/db/datas_alpr/collaborative_area.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
[{"_id":"0b6a375f-be3e-49a9-9827-3c2d5eddb057","abstractobject":{"id":"0b6a375f-be3e-49a9-9827-3c2d5eddb057","name":"test","is_draft":false,"creator_id":"c0cece97-7730-4c2a-8c20-a30944564106","creation_date":{"$date":"2025-01-27T10:41:47.741Z"},"update_date":{"$date":"2025-01-27T10:41:47.741Z"},"updater_id":"c0cece97-7730-4c2a-8c20-a30944564106","access_mode":0},"description":"Proto Collaborative area example","collaborative_area":{},"workflows":["58314c99-c595-4ca2-8b5e-822a6774efed"],"allowed_peers_group":{"c0cece97-7730-4c2a-8c20-a30944564106":["*"]},"workspaces":[]}]
|
||||||
1
docker/db/datas_alpr/compute_resource.json
Normal file
1
docker/db/datas_alpr/compute_resource.json
Normal file
File diff suppressed because one or more lines are too long
1
docker/db/datas_alpr/data_resource.json
Normal file
1
docker/db/datas_alpr/data_resource.json
Normal file
File diff suppressed because one or more lines are too long
1
docker/db/datas_alpr/peer.json
Normal file
1
docker/db/datas_alpr/peer.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
[{"_id":"c0cece97-7730-4c2a-8c20-a30944564106","failed_execution":null,"abstractobject":{"update_date":{"$date":"2025-03-27T09:13:13.230Z"},"access_mode":0,"id":"c0cece97-7730-4c2a-8c20-a30944564106","name":"local","is_draft":false,"creation_date":{"$date":"2025-03-27T09:13:13.230Z"}},"url":"http://localhost:8000","wallet_address":"my-wallet","public_key":"-----BEGIN RSA PUBLIC KEY-----\nMIICCgKCAgEAw2pdG6wMtuLcP0+k1LFvIb0DQo/oHW2uNJaEJK74plXqp4ztz2dR\nb+RQHFLeLuqk4i/zc3b4K3fKPXSlwnVPJCwzPrnyT8jYGOZVlWlETiV9xeJhu6s/\nBh6g1PWz75XjjwV50iv/CEiLNBT23f/3J44wrQzygqNQCiQSALdxWLAEl4l5kHSa\n9oMyV70/Uql94/ayMARZsHgp9ZvqQKbkZPw6yzVMfCBxQozlNlo315OHevudhnhp\nDRjN5I7zWmqYt6rbXJJC7Y3Izdvzn7QI88RqjSRST5I/7Kz3ndCqrOnI+OQUE5NT\nREyQebphvQfTDTKlRPXkdyktdK2DH28Zj6ZF3yjQvN35Q4zhOzlq77dO5IhhopI7\nct8dZH1T1nYkvdyCA/EVMtQsASmBOitH0Y0ACoXQK5Kb6nm/TcM/9ZSJUNiEMuy5\ngBZ3YKE9oa4cpTpPXwcA+S/cU7HPNnQAsvD3iJi8GTW9uJs84pn4/WhpQqmXd4rv\nhKWECCN3fHy01fUs/U0PaSj2jDY/kQVeXoikNMzPUjdZd9m816TIBh3v3aVXCH/0\niTHHAxctvDgMRb2fpvRJ/wwnYjFG9RpamVFDMvC9NffuYzWAA9IRIY4cqgerfHrV\nZ2HHiPTDDvDAIsvImXZc/h7mXN6m3RCQ4Qywy993wd9gUdgg/qnynHcCAwEAAQ==\n-----END RSA PUBLIC KEY-----\n","state":1}]
|
||||||
1
docker/db/datas_alpr/processing_resource.json
Normal file
1
docker/db/datas_alpr/processing_resource.json
Normal file
File diff suppressed because one or more lines are too long
1
docker/db/datas_alpr/storage_resource.json
Normal file
1
docker/db/datas_alpr/storage_resource.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
[{"_id":"04bc70b5-8d7b-44e6-9015-fadfa0fb102d","abstractinstanciatedresource":{"abstractresource":{"type":"storage","abstractobject":{"id":"04bc70b5-8d7b-44e6-9015-fadfa0fb102d","name":"IRT risk database","is_draft":false,"creator_id":"c0cece97-7730-4c2a-8c20-a30944564106","creation_date":"2021-09-30T14:00:00.000Z","update_date":"2021-09-30T14:00:00.000Z","updater_id":"c0cece97-7730-4c2a-8c20-a30944564106","access_mode":1},"logo":"https://cloud.o-forge.io/core/deperecated-oc-catalog/raw/branch/main/scripts/local_imgs/IRT risk database.png","description":"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.","short_description":"S3 compliant IRT file storage","owners":[{"name":"IRT"}]},"instances":[{"env":[{"attr":"source","readonly":true}],"resourceinstance":{"abstractobject":{"id":"7fdccb9c-7090-40a5-bacd-7435bc56c90d","name":"IRT local file storage Marseille"},"location":{"latitude":50.62925,"longitude":3.057256},"country":250,"partnerships":[{"resourcepartnership":{"namespace":"default","peer_groups":{"c0cece97-7730-4c2a-8c20-a30944564106":["*"]},"pricing_profiles":[{"pricing":{"price":50,"currency":"EUR","buying_strategy":0,"time_pricing_strategy":0}}]}}]},"source":"/mnt/vol","local":false,"security_level":"public","size":50,"size_type":3,"redundancy":"RAID5","throughput":"r:200,w:150"}]},"storage_type":5,"acronym":"DC_myDC"},{"_id":"e726020a-b68e-4abc-ab36-c3640ea3f557","abstractinstanciatedresource":{"abstractresource":{"type":"storage","abstractobject":{"id":"e726020a-b68e-4abc-ab36-c3640ea3f557","name":"IRT local file storage","is_draft":false,"creator_id":"c0cece97-7730-4c2a-8c20-a30944564106","creation_date":"2021-09-30T14:00:00.000Z","update_date":"2021-09-30T14:00:00.000Z","updater_id":"c0cece97-7730-4c2a-8c20-a30944564106","access_mode":1},"logo":"https://cloud.o-forge.io/core/deperecated-oc-catalog/raw/branch/main/scripts/local_imgs/IRT local file storage.png","description":"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.","short_description":"S3 compliant IRT file storage","owners":[{"name":"IRT"}]},"instances":[{"resourceinstance":{"env":[{"attr":"source","readonly":true}],"abstractobject":{"id":"7fdccb9c-7090-40a5-bacd-7435bc56c90d","name":"IRT local file storage Marseille"},"location":{"latitude":50.62925,"longitude":3.057256},"country":250,"partnerships":[{"resourcepartnership":{"namespace":"default","peer_groups":{"c0cece97-7730-4c2a-8c20-a30944564106":["*"]},"pricing_profiles":[{"pricing":{"price":50,"currency":"EUR","buying_strategy":0,"time_pricing_strategy":0}}]}}]},"source":"/mnt/vol","local":true,"security_level":"public","size":500,"size_type":0,"encryption":true,"redundancy":"RAID5S","throughput":"r:300,w:350"}]},"storage_type":5,"acronym":"DC_myDC"}]
|
||||||
1
docker/db/datas_alpr/workflow.json
Normal file
1
docker/db/datas_alpr/workflow.json
Normal file
File diff suppressed because one or more lines are too long
56
docker/start-demo.sh
Executable file
56
docker/start-demo.sh
Executable file
@@ -0,0 +1,56 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
server=$(grep 'server:' ~/.kube/config | awk '{print $2}')
|
||||||
|
|
||||||
|
host=$(ip -4 addr show $(ip route | awk '/default/ {print $5}') | awk '/inet / {print $2}' | cut -d/ -f1)
|
||||||
|
port=6443
|
||||||
|
ca=$(kubectl config view --raw --minify -o jsonpath='{.clusters[0].cluster.certificate-authority-data}')
|
||||||
|
cert=$(kubectl config view --raw --minify -o jsonpath='{.users[0].user.client-certificate-data}')
|
||||||
|
key=$(kubectl config view --raw --minify -o jsonpath='{.users[0].user.client-key-data}')
|
||||||
|
|
||||||
|
HOST=${2:-"http://localhost:8000"}
|
||||||
|
docker network create oc | true
|
||||||
|
|
||||||
|
docker compose down
|
||||||
|
|
||||||
|
cd ./tools && docker compose -f ./docker-compose.dev.yml down --force-recreate -d && docker compose -f ./docker-compose.traefik.yml down --force-recreate -d
|
||||||
|
docker compose -f ./docker-compose.dev.yml up --force-recreate -d && docker compose -f ./docker-compose.traefik.yml up --force-recreate -d && cd ..
|
||||||
|
|
||||||
|
|
||||||
|
cd ./db && ./add.sh && cd ..
|
||||||
|
|
||||||
|
cd ../..
|
||||||
|
|
||||||
|
REPOS=(
|
||||||
|
"oc-auth"
|
||||||
|
"oc-catalog"
|
||||||
|
"oc-datacenter"
|
||||||
|
"oc-monitord"
|
||||||
|
"oc-peer"
|
||||||
|
"oc-shared"
|
||||||
|
"oc-scheduler"
|
||||||
|
"oc-schedulerd"
|
||||||
|
"oc-workflow"
|
||||||
|
"oc-workspace"
|
||||||
|
"oc-front"
|
||||||
|
)
|
||||||
|
for i in "${REPOS[@]}"
|
||||||
|
do
|
||||||
|
echo "Building $i"
|
||||||
|
docker kill $i | true
|
||||||
|
docker rm $i | true
|
||||||
|
cd ./$i
|
||||||
|
cat <<EOT > ./env.env
|
||||||
|
KUBERNETES_SERVICE_HOST=$host
|
||||||
|
KUBE_CA="$ca"
|
||||||
|
KUBE_CERT="$cert"
|
||||||
|
KUBE_DATA="$key"
|
||||||
|
EOT
|
||||||
|
|
||||||
|
|
||||||
|
docker build . -t $i --build-arg=HOST=$HOST --build-arg=KUBERNETES_SERVICE_HOST=$host \
|
||||||
|
--build-arg=KUBERNETES_SERVICE_PORT=$port --build-arg=KUBE_CA=$ca --build-arg=KUBE_CERT=$cert \
|
||||||
|
--build-arg=KUBE_DATA=$key && docker compose up -d
|
||||||
|
cd ..
|
||||||
|
done
|
||||||
|
|
||||||
|
cd ./oc-deploy/docker/tools && docker compose -f ./docker-compose.dev.yml up hydra-client --force-recreate -d
|
||||||
50
docker/start.sh
Executable file
50
docker/start.sh
Executable file
@@ -0,0 +1,50 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
server=$(grep 'server:' ~/.kube/config | awk '{print $2}')
|
||||||
|
|
||||||
|
host=$(ip -4 addr show $(ip route | awk '/default/ {print $5}') | awk '/inet / {print $2}' | cut -d/ -f1)
|
||||||
|
port=6443
|
||||||
|
ca=$(kubectl config view --raw --minify -o jsonpath='{.clusters[0].cluster.certificate-authority-data}')
|
||||||
|
cert=$(kubectl config view --raw --minify -o jsonpath='{.users[0].user.client-certificate-data}')
|
||||||
|
key=$(kubectl config view --raw --minify -o jsonpath='{.users[0].user.client-key-data}')
|
||||||
|
|
||||||
|
export HOST=${HOST:-"http://localhost:8000"}
|
||||||
|
docker network create oc | true
|
||||||
|
|
||||||
|
docker compose down
|
||||||
|
cd ./tools && docker compose -f ./docker-compose.dev.yml up --force-recreate -d
|
||||||
|
docker compose -f ./docker-compose.traefik.yml up --force-recreate -d && cd ..
|
||||||
|
|
||||||
|
|
||||||
|
cd ../..
|
||||||
|
|
||||||
|
REPOS=(
|
||||||
|
"oc-auth"
|
||||||
|
"oc-catalog"
|
||||||
|
"oc-datacenter"
|
||||||
|
"oc-monitord"
|
||||||
|
"oc-peer"
|
||||||
|
"oc-shared"
|
||||||
|
"oc-scheduler"
|
||||||
|
"oc-schedulerd"
|
||||||
|
"oc-workflow"
|
||||||
|
"oc-workspace"
|
||||||
|
"oc-front"
|
||||||
|
)
|
||||||
|
for i in "${REPOS[@]}"
|
||||||
|
do
|
||||||
|
echo "Building $i"
|
||||||
|
docker kill $i | true
|
||||||
|
docker rm $i | true
|
||||||
|
cd ./$i
|
||||||
|
cat > ./env.env <<EOF
|
||||||
|
KUBERNETES_SERVICE_HOST=$hostdocker
|
||||||
|
KUBERNETES_SERVICE_PORT=$port
|
||||||
|
KUBE_CA="$ca"
|
||||||
|
KUBE_CERT="$cert"
|
||||||
|
KUBE_DATA="$key"
|
||||||
|
EOF
|
||||||
|
make run-docker
|
||||||
|
cd ..
|
||||||
|
done
|
||||||
|
|
||||||
|
cd ./oc-deploy/docker/tools && docker compose -f ./docker-compose.dev.yml up hydra-client --force-recreate -d
|
||||||
50
docker/stop.sh
Executable file
50
docker/stop.sh
Executable file
@@ -0,0 +1,50 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
docker network delete oc | true
|
||||||
|
|
||||||
|
docker compose -f ./tools/docker-compose.traefik.yml down
|
||||||
|
|
||||||
|
TOOLS=(
|
||||||
|
"mongo"
|
||||||
|
"mongo-express"
|
||||||
|
"nats"
|
||||||
|
"loki"
|
||||||
|
"grafana"
|
||||||
|
"hydra-client"
|
||||||
|
"hydra"
|
||||||
|
"keto"
|
||||||
|
"ldap"
|
||||||
|
)
|
||||||
|
|
||||||
|
for i in "${TOOLS[@]}"
|
||||||
|
do
|
||||||
|
echo "kill $i"
|
||||||
|
docker kill $i | true
|
||||||
|
docker rm $i | true
|
||||||
|
done
|
||||||
|
|
||||||
|
docker volume rm tools_oc-data
|
||||||
|
|
||||||
|
cd ../..
|
||||||
|
|
||||||
|
REPOS=(
|
||||||
|
"oc-auth"
|
||||||
|
"oc-catalog"
|
||||||
|
"oc-datacenter"
|
||||||
|
"oc-monitord"
|
||||||
|
"oc-peer"
|
||||||
|
"oc-shared"
|
||||||
|
"oc-scheduler"
|
||||||
|
"oc-schedulerd"
|
||||||
|
"oc-workflow"
|
||||||
|
"oc-workspace"
|
||||||
|
"oc-front"
|
||||||
|
)
|
||||||
|
for i in "${REPOS[@]}"
|
||||||
|
do
|
||||||
|
echo "Kill $i"
|
||||||
|
cd ./$i
|
||||||
|
docker kill $i | true
|
||||||
|
docker rm $i | true
|
||||||
|
make purge | true
|
||||||
|
cd ..
|
||||||
|
done
|
||||||
8
docker/tools/conf/grafana_data_source.yml
Normal file
8
docker/tools/conf/grafana_data_source.yml
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
datasources:
|
||||||
|
- name: Loki
|
||||||
|
type: loki
|
||||||
|
access: proxy
|
||||||
|
url: http://loki:3100
|
||||||
|
isDefault: true
|
||||||
|
jsonData:
|
||||||
|
httpMethod: POST
|
||||||
163
docker/tools/docker-compose.dev.yml
Normal file
163
docker/tools/docker-compose.dev.yml
Normal file
@@ -0,0 +1,163 @@
|
|||||||
|
version: '3.4'
|
||||||
|
|
||||||
|
services:
|
||||||
|
mongo:
|
||||||
|
image: 'mongo:latest'
|
||||||
|
networks:
|
||||||
|
- oc
|
||||||
|
ports:
|
||||||
|
- 27017:27017
|
||||||
|
container_name: mongo
|
||||||
|
volumes:
|
||||||
|
- oc-data:/data/db
|
||||||
|
- oc-data:/data/configdb
|
||||||
|
|
||||||
|
mongo-express:
|
||||||
|
image: "mongo-express:latest"
|
||||||
|
restart: always
|
||||||
|
depends_on:
|
||||||
|
- mongo
|
||||||
|
networks:
|
||||||
|
- oc
|
||||||
|
ports:
|
||||||
|
- 8081:8081
|
||||||
|
environment:
|
||||||
|
- ME_CONFIG_BASICAUTH_USERNAME=test
|
||||||
|
- ME_CONFIG_BASICAUTH_PASSWORD=test
|
||||||
|
nats:
|
||||||
|
image: 'nats:latest'
|
||||||
|
container_name: nats
|
||||||
|
ports:
|
||||||
|
- 4222:4222
|
||||||
|
command:
|
||||||
|
- "--debug"
|
||||||
|
networks:
|
||||||
|
- oc
|
||||||
|
loki:
|
||||||
|
image: 'grafana/loki'
|
||||||
|
container_name: loki
|
||||||
|
labels:
|
||||||
|
- "traefik.enable=true"
|
||||||
|
- "traefik.http.routers.loki.entrypoints=web"
|
||||||
|
- "traefik.http.routers.loki.rule=PathPrefix(`/tools/loki`)"
|
||||||
|
- "traefik.http.services.loki.loadbalancer.server.port=3100"
|
||||||
|
- "traefik.http.middlewares.loki-stripprefix.stripprefix.prefixes=/tools/loki"
|
||||||
|
- "traefik.http.routers.loki.middlewares=loki-stripprefix"
|
||||||
|
- "traefik.http.middlewares.loki.forwardauth.address=http://oc-auth:8080/oc/forward"
|
||||||
|
ports :
|
||||||
|
- "3100:3100"
|
||||||
|
networks:
|
||||||
|
- oc
|
||||||
|
grafana:
|
||||||
|
image: 'grafana/grafana'
|
||||||
|
container_name: grafana
|
||||||
|
ports:
|
||||||
|
- '3000:3000'
|
||||||
|
labels:
|
||||||
|
- "traefik.enable=true"
|
||||||
|
- "traefik.http.routers.grafana.entrypoints=web"
|
||||||
|
- "traefik.http.routers.grafana.rule=PathPrefix(`/tools/grafana`)"
|
||||||
|
- "traefik.http.services.grafana.loadbalancer.server.port=3000"
|
||||||
|
- "traefik.http.middlewares.grafana-stripprefix.stripprefix.prefixes=/tools/grafana"
|
||||||
|
- "traefik.http.routers.grafana.middlewares=grafana-stripprefix"
|
||||||
|
- "traefik.http.middlewares.grafana.forwardauth.address=http://oc-auth:8080/oc/forward"
|
||||||
|
networks:
|
||||||
|
- oc
|
||||||
|
volumes:
|
||||||
|
- ./conf/grafana_data_source.yml:/etc/grafana/provisioning/datasources/datasource.yml
|
||||||
|
environment:
|
||||||
|
- GF_SECURITY_ADMIN_PASSWORD=pfnirt # Change this to anything but admin to not have a password change page at startup
|
||||||
|
- GF_SECURITY_ADMIN_USER=admin
|
||||||
|
- GF_SECURITY_DISABLE_INITIAL_ADMIN_PASSWORD_CHANGE=true
|
||||||
|
hydra:
|
||||||
|
container_name: hydra
|
||||||
|
image: oryd/hydra:v2.2.0
|
||||||
|
environment:
|
||||||
|
SECRETS_SYSTEM: oc-auth-got-secret
|
||||||
|
LOG_LEAK_SENSITIVE_VALUES: true
|
||||||
|
# OAUTH2_TOKEN_HOOK_URL: http://oc-auth:8080/oc/claims
|
||||||
|
URLS_SELF_ISSUER: http://hydra:4444
|
||||||
|
URLS_SELF_PUBLIC: http://hydra:4444
|
||||||
|
WEBFINGER_OIDC_DISCOVERY_SUPPORTED_SCOPES: profile,email,phone,roles
|
||||||
|
WEBFINGER_OIDC_DISCOVERY_SUPPORTED_CLAIMS: name,family_name,given_name,nickname,email,phone_number
|
||||||
|
DSN: memory
|
||||||
|
command: serve all --dev
|
||||||
|
networks:
|
||||||
|
- oc
|
||||||
|
ports:
|
||||||
|
- "4444:4444"
|
||||||
|
- "4445:4445"
|
||||||
|
deploy:
|
||||||
|
restart_policy:
|
||||||
|
condition: on-failure
|
||||||
|
ldap:
|
||||||
|
image: pgarrett/ldap-alpine
|
||||||
|
container_name: ldap
|
||||||
|
volumes:
|
||||||
|
- "./ldap.ldif:/ldif/ldap.ldif"
|
||||||
|
networks:
|
||||||
|
- oc
|
||||||
|
ports:
|
||||||
|
- "390:389"
|
||||||
|
deploy:
|
||||||
|
restart_policy:
|
||||||
|
condition: on-failure
|
||||||
|
keto:
|
||||||
|
image: oryd/keto:v0.7.0-alpha.1-sqlite
|
||||||
|
ports:
|
||||||
|
- "4466:4466"
|
||||||
|
- "4467:4467"
|
||||||
|
command: serve -c /home/ory/keto.yml
|
||||||
|
restart: on-failure
|
||||||
|
volumes:
|
||||||
|
- type: bind
|
||||||
|
source: .
|
||||||
|
target: /home/ory
|
||||||
|
container_name: keto
|
||||||
|
networks:
|
||||||
|
- oc
|
||||||
|
|
||||||
|
hydra-client:
|
||||||
|
image: oryd/hydra:v2.2.0
|
||||||
|
container_name: hydra-client
|
||||||
|
environment:
|
||||||
|
HYDRA_ADMIN_URL: http://hydra:4445
|
||||||
|
ORY_SDK_URL: http://hydra:4445
|
||||||
|
command:
|
||||||
|
- create
|
||||||
|
- oauth2-client
|
||||||
|
- --skip-tls-verify
|
||||||
|
- --name
|
||||||
|
- test-client
|
||||||
|
- --secret
|
||||||
|
- oc-auth-got-secret
|
||||||
|
- --response-type
|
||||||
|
- id_token,token,code
|
||||||
|
- --grant-type
|
||||||
|
- implicit,refresh_token,authorization_code,client_credentials
|
||||||
|
- --scope
|
||||||
|
- openid,profile,email,roles
|
||||||
|
- --token-endpoint-auth-method
|
||||||
|
- client_secret_post
|
||||||
|
- --redirect-uri
|
||||||
|
- http://localhost:3000
|
||||||
|
|
||||||
|
networks:
|
||||||
|
- oc
|
||||||
|
deploy:
|
||||||
|
restart_policy:
|
||||||
|
condition: none
|
||||||
|
depends_on:
|
||||||
|
- hydra
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD", "curl", "-f", "http://hydra:4445"]
|
||||||
|
interval: 10s
|
||||||
|
timeout: 10s
|
||||||
|
retries: 10
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
oc-data:
|
||||||
|
|
||||||
|
networks:
|
||||||
|
oc:
|
||||||
|
external: true
|
||||||
26
docker/tools/docker-compose.traefik.yml
Normal file
26
docker/tools/docker-compose.traefik.yml
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
version: '3.9'
|
||||||
|
|
||||||
|
services:
|
||||||
|
traefik:
|
||||||
|
image: traefik:v3.6
|
||||||
|
container_name: traefik
|
||||||
|
restart: unless-stopped
|
||||||
|
networks:
|
||||||
|
- oc
|
||||||
|
command:
|
||||||
|
- "--api.insecure=true"
|
||||||
|
- "--providers.docker=true"
|
||||||
|
- "--providers.docker.exposedbydefault=false"
|
||||||
|
- "--entrypoints.web.address=:8000"
|
||||||
|
user: root
|
||||||
|
ports:
|
||||||
|
- "8000:8000" # Expose Traefik on port 8000
|
||||||
|
volumes:
|
||||||
|
- /var/run/docker.sock:/var/run/docker.sock:ro
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
oc-data:
|
||||||
|
|
||||||
|
networks:
|
||||||
|
oc:
|
||||||
|
external: true
|
||||||
18
docker/tools/keto.yml
Normal file
18
docker/tools/keto.yml
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
version: v0.6.0-alpha.1
|
||||||
|
|
||||||
|
log:
|
||||||
|
level: debug
|
||||||
|
|
||||||
|
namespaces:
|
||||||
|
- id: 0
|
||||||
|
name: open-cloud
|
||||||
|
|
||||||
|
dsn: memory
|
||||||
|
|
||||||
|
serve:
|
||||||
|
read:
|
||||||
|
host: 0.0.0.0
|
||||||
|
port: 4466
|
||||||
|
write:
|
||||||
|
host: 0.0.0.0
|
||||||
|
port: 4467
|
||||||
24
docker/tools/ldap.ldif
Normal file
24
docker/tools/ldap.ldif
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
dn: uid=admin,ou=Users,dc=example,dc=com
|
||||||
|
objectClass: inetOrgPerson
|
||||||
|
cn: Admin
|
||||||
|
sn: Istrator
|
||||||
|
uid: admin
|
||||||
|
userPassword: admin
|
||||||
|
mail: admin@example.com
|
||||||
|
ou: Users
|
||||||
|
|
||||||
|
dn: ou=AppRoles,dc=example,dc=com
|
||||||
|
objectClass: organizationalunit
|
||||||
|
ou: AppRoles
|
||||||
|
description: AppRoles
|
||||||
|
|
||||||
|
dn: ou=App1,ou=AppRoles,dc=example,dc=com
|
||||||
|
objectClass: organizationalunit
|
||||||
|
ou: App1
|
||||||
|
description: App1
|
||||||
|
|
||||||
|
dn: cn=traveler,ou=App1,ou=AppRoles,dc=example,dc=com
|
||||||
|
objectClass: groupofnames
|
||||||
|
cn: traveler
|
||||||
|
description: traveler
|
||||||
|
member: uid=admin,ou=Users,dc=example,dc=com
|
||||||
53
docs/diagrams/src/oc-deploy.puml
Normal file
53
docs/diagrams/src/oc-deploy.puml
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
@startuml Arch Diagram
|
||||||
|
|
||||||
|
top to bottom direction
|
||||||
|
|
||||||
|
component front as "oc-front" #MistyRose
|
||||||
|
|
||||||
|
component api as "oc-api" #BlueViolet
|
||||||
|
component auth as "oc-auth" #BlueViolet
|
||||||
|
|
||||||
|
component catalog as "oc-catalog" #MistyRose
|
||||||
|
component workspace as "oc-workspace" #MistyRose
|
||||||
|
component workflow as "oc-workflow" #MistyRose
|
||||||
|
component calendarIn as "oc-calendar-in" #MistyRose
|
||||||
|
component calendarOut as "oc-calendar-out" #MistyRose
|
||||||
|
component stat as "oc-status" #MistyRose
|
||||||
|
|
||||||
|
component disco as "oc-discovery" #MistyRose
|
||||||
|
component agg as "oc-aggregator" #MistyRose
|
||||||
|
|
||||||
|
component scheduler as "oc-scheduler" #LightYellow
|
||||||
|
component monitor as "oc-monitor" #LightYellow
|
||||||
|
|
||||||
|
database rd as "Nats" #Green
|
||||||
|
database zn as "Zinc" #Green
|
||||||
|
database loki as "Loki" #Green
|
||||||
|
database mongo as "MongoDB" #Green
|
||||||
|
database nats as "Nats" #Green
|
||||||
|
|
||||||
|
front -- api
|
||||||
|
|
||||||
|
api -- auth : auth user
|
||||||
|
api -- catalog : local search
|
||||||
|
api -- workspace : store user data
|
||||||
|
api -- workflow
|
||||||
|
api -- calendarIn
|
||||||
|
api -- calendarOut
|
||||||
|
api -- stat
|
||||||
|
|
||||||
|
catalog -- disco
|
||||||
|
catalog -- agg
|
||||||
|
|
||||||
|
scheduler -- monitor
|
||||||
|
scheduler -- catalog
|
||||||
|
|
||||||
|
rd -- scheduler
|
||||||
|
loki -- monitor
|
||||||
|
|
||||||
|
catalog -- mongo : store resources available for users
|
||||||
|
workspace -- mongo : store resources allocated to a workspace
|
||||||
|
workflow -- mongo : store workflow
|
||||||
|
calendarOut -- mongo : store booking informations for this dc
|
||||||
|
|
||||||
|
@enduml
|
||||||
5
env.env
Normal file
5
env.env
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
KUBERNETES_SERVICE_HOST=127.0.0.1
|
||||||
|
KUBERNETES_SERVICE_PORT=6443
|
||||||
|
KUBE_CA=""
|
||||||
|
KUBE_CERT=""
|
||||||
|
KUBE_DATA=""
|
||||||
0
envs/cluster-1.env
Normal file
0
envs/cluster-1.env
Normal file
0
envs/cluster-2.env
Normal file
0
envs/cluster-2.env
Normal file
60
k8s/README.md
Normal file
60
k8s/README.md
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
## TO START DEMO
|
||||||
|
|
||||||
|
`./start-demo.sh <num of cluster>`
|
||||||
|
|
||||||
|
To navigate between clusters : `export KUBECONFIG=configCluster<n>`
|
||||||
|
|
||||||
|
After mongodb pod launch on every cluster:
|
||||||
|
|
||||||
|
`./add-datas-demo.sh <num of cluster>`
|
||||||
|
|
||||||
|
## Deploy the opencloud chart
|
||||||
|
|
||||||
|
```
|
||||||
|
./start.sh <mode: dev|prod default:dev> <branche | default:main>
|
||||||
|
```
|
||||||
|
|
||||||
|
Feel free to modify/create a new opencloud/dev-values.yaml. Provided setup should work out of the box, but is not suitable for production usage.
|
||||||
|
|
||||||
|
## k8s deployment
|
||||||
|
|
||||||
|
- Pull oc-k8s file put it in /usr/local/bin
|
||||||
|
- oc-k8s create values <namespace>
|
||||||
|
|
||||||
|
## Hostname settings
|
||||||
|
|
||||||
|
Edit your /etc/hosts file, and add following line:
|
||||||
|
|
||||||
|
```
|
||||||
|
127.0.0.1 beta.opencloud.com
|
||||||
|
```
|
||||||
|
|
||||||
|
## Done
|
||||||
|
|
||||||
|
Everything should be operational now, go to http://beta.opencloud.com and enjoy the ride
|
||||||
|
|
||||||
|
# Prebuilt microservices deployment procedure
|
||||||
|
|
||||||
|
TODO
|
||||||
|
|
||||||
|
# First steps
|
||||||
|
|
||||||
|
Go to http://beta.opencloud.com/users
|
||||||
|
|
||||||
|
Log in using default user/password combo ldapadmin/ldapadmin
|
||||||
|
|
||||||
|
Create a new user, or change the default one
|
||||||
|
|
||||||
|
Go to http://beta.opencloud.com
|
||||||
|
|
||||||
|
Log in using your fresh credentials
|
||||||
|
|
||||||
|
Do stuff
|
||||||
|
|
||||||
|
You can go to http://beta.opencloud.com/mongoexpress
|
||||||
|
|
||||||
|
... for mongo express web client access (default login/password is test/testme)
|
||||||
|
|
||||||
|
You can go to http://localhost/dashboard/
|
||||||
|
|
||||||
|
... for access to Traefik reverse proxy front-end
|
||||||
9
k8s/add-datas-demo.sh
Executable file
9
k8s/add-datas-demo.sh
Executable file
@@ -0,0 +1,9 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
start=1
|
||||||
|
end=${1:-1}
|
||||||
|
|
||||||
|
for ((i=start; i<=end; i++)); do
|
||||||
|
export KUBECONFIG=~/.kube/configCluster$i
|
||||||
|
oc-k8s upgrade db -d opencloud -r cluster-$i -n cluster-$i -f ./datas/cluster-$i
|
||||||
|
done
|
||||||
656
k8s/cluster-1-values.yaml
Normal file
656
k8s/cluster-1-values.yaml
Normal file
@@ -0,0 +1,656 @@
|
|||||||
|
env: cluster-1 # For storage class provisioning
|
||||||
|
clusterName: cluster-1
|
||||||
|
hostNetwork: true
|
||||||
|
host: beta.opencloud.com
|
||||||
|
hostPort: 9600
|
||||||
|
registryHost: opencloudregistry
|
||||||
|
scheme: http
|
||||||
|
|
||||||
|
secrets:
|
||||||
|
keys:
|
||||||
|
enabled: true
|
||||||
|
name: libp2p-keys
|
||||||
|
mountPath: ./pem
|
||||||
|
psk:
|
||||||
|
enabled: true
|
||||||
|
name: libp2p-psk
|
||||||
|
mountPath: ./psk
|
||||||
|
|
||||||
|
mongo-express:
|
||||||
|
enabled: true
|
||||||
|
mongodbServer: "cluster-1-mongodb.cluster-1" # TO LOOK AFTER
|
||||||
|
mongodbPort: 27017
|
||||||
|
mongodbEnableAdmin: true
|
||||||
|
mongodbAdminUsername: admin
|
||||||
|
mongodbAdminPassword: admin
|
||||||
|
siteBaseUrl: /mongoexpress
|
||||||
|
basicAuthUsername: admin
|
||||||
|
basicAuthPassword: admin
|
||||||
|
mongodb:
|
||||||
|
enabled: false
|
||||||
|
|
||||||
|
mongodb:
|
||||||
|
enabled: true
|
||||||
|
global:
|
||||||
|
defaultStorageClass: "standard"
|
||||||
|
storageClass: "standard"
|
||||||
|
architecture: standalone
|
||||||
|
useStatefulSet: false
|
||||||
|
auth:
|
||||||
|
enabled: true
|
||||||
|
rootUser: admin
|
||||||
|
rootPassword: admin
|
||||||
|
databases: [ opencloud ]
|
||||||
|
usernames: [ admin ]
|
||||||
|
passwords: [ admin ]
|
||||||
|
resourcesPreset: "small"
|
||||||
|
replicaCount: 1
|
||||||
|
persistence:
|
||||||
|
enabled: true
|
||||||
|
create: false # do not auto-create
|
||||||
|
existingClaim: mongo-pvc
|
||||||
|
storageClassName: "standard"
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
size: 5Gi
|
||||||
|
persistentVolumeClaimRetentionPolicy:
|
||||||
|
enabled: true
|
||||||
|
whenDeleted: Retain
|
||||||
|
whenScaled: Retain
|
||||||
|
arbiter:
|
||||||
|
enabled: false
|
||||||
|
livenessProbe:
|
||||||
|
enabled: true
|
||||||
|
readinessProbe:
|
||||||
|
enabled: true
|
||||||
|
|
||||||
|
nats:
|
||||||
|
enabled: true
|
||||||
|
extraEnv:
|
||||||
|
- name: NATS_MAX_FILE_DESCRIPTORS
|
||||||
|
value: "65536"
|
||||||
|
extraVolumeMounts:
|
||||||
|
- name: nats-config
|
||||||
|
mountPath: /etc/nats
|
||||||
|
config:
|
||||||
|
jetstream:
|
||||||
|
enabled: true
|
||||||
|
fileStore:
|
||||||
|
enabled: true
|
||||||
|
dir: /data/jetstream # mountPath used by template
|
||||||
|
# pvc block must live here
|
||||||
|
pvc:
|
||||||
|
enabled: true
|
||||||
|
# if you already created the claim, set existingClaim:
|
||||||
|
existingClaim: nats-pvc
|
||||||
|
# storageClassName: local-path or standard (use the SC in your cluster)
|
||||||
|
storageClassName: standard
|
||||||
|
size: 50Gi
|
||||||
|
# name is the volume name used in volumeMounts; keep it simple
|
||||||
|
name: nats-jetstream
|
||||||
|
|
||||||
|
openldap:
|
||||||
|
enabled: true
|
||||||
|
test:
|
||||||
|
enabled: false
|
||||||
|
ltb-passwd:
|
||||||
|
enabled: false
|
||||||
|
replicaCount: 1
|
||||||
|
image:
|
||||||
|
repository: osixia/openldap
|
||||||
|
tls:
|
||||||
|
enabled: false
|
||||||
|
env:
|
||||||
|
LDAP_ORGANISATION: Opencloud
|
||||||
|
LDAP_DOMAIN: opencloud.com
|
||||||
|
LDAP_BACKEND: "mdb"
|
||||||
|
LDAP_TLS: "false"
|
||||||
|
LDAP_TLS_ENFORCE: "false"
|
||||||
|
LDAP_REMOVE_CONFIG_AFTER_SETUP: "true"
|
||||||
|
adminPassword: admin
|
||||||
|
configPassword: configadmin
|
||||||
|
phpldapadmin:
|
||||||
|
enabled: false
|
||||||
|
persistence:
|
||||||
|
enabled: true
|
||||||
|
create: false # do not auto-create
|
||||||
|
existingClaim: openldap-pvc
|
||||||
|
accessMode: ReadWriteOnce
|
||||||
|
size: 10Mi
|
||||||
|
storageClassName: ""
|
||||||
|
replication:
|
||||||
|
enabled: false
|
||||||
|
externalLDAP:
|
||||||
|
enabled: false
|
||||||
|
url: 389
|
||||||
|
bindDN: uid=admin,dc=opencloud,dc=com
|
||||||
|
bindPassword: admin
|
||||||
|
customLdifFiles:
|
||||||
|
01-schema.ldif: |-
|
||||||
|
dn: ou=groups,dc=opencloud,dc=com
|
||||||
|
objectClass: organizationalUnit
|
||||||
|
ou: groups
|
||||||
|
|
||||||
|
dn: ou=users,dc=opencloud,dc=com
|
||||||
|
objectClass: organizationalUnit
|
||||||
|
ou: users
|
||||||
|
|
||||||
|
dn: cn=lastGID,dc=opencloud,dc=com
|
||||||
|
objectClass: device
|
||||||
|
objectClass: top
|
||||||
|
description: Records the last GID used to create a Posix group. This prevents the re-use of a GID from a deleted group.
|
||||||
|
cn: lastGID
|
||||||
|
serialNumber: 2001
|
||||||
|
|
||||||
|
dn: cn=lastUID,dc=opencloud,dc=com
|
||||||
|
objectClass: device
|
||||||
|
objectClass: top
|
||||||
|
serialNumber: 2001
|
||||||
|
description: Records the last UID used to create a Posix account. This prevents the re-use of a UID from a deleted account.
|
||||||
|
cn: lastUID
|
||||||
|
|
||||||
|
dn: cn=everybody,ou=groups,dc=opencloud,dc=com
|
||||||
|
objectClass: top
|
||||||
|
objectClass: posixGroup
|
||||||
|
cn: everybody
|
||||||
|
memberUid: admin
|
||||||
|
gidNumber: 2003
|
||||||
|
|
||||||
|
02-ldapadmin.ldif : |-
|
||||||
|
dn: cn=ldapadmin,ou=groups,dc=opencloud,dc=com
|
||||||
|
objectClass: top
|
||||||
|
objectClass: posixGroup
|
||||||
|
cn: ldapadmin
|
||||||
|
memberUid: ldapadmin
|
||||||
|
gidNumber: 2001
|
||||||
|
|
||||||
|
dn: uid=ldapadmin,ou=users,dc=opencloud,dc=com
|
||||||
|
givenName: ldap
|
||||||
|
sn: admin
|
||||||
|
uid: ldapadmin
|
||||||
|
cn: ldapadmin
|
||||||
|
mail: ldapadmin@example.com
|
||||||
|
objectClass: person
|
||||||
|
objectClass: inetOrgPerson
|
||||||
|
objectClass: posixAccount
|
||||||
|
userPassword: sai1yeiT
|
||||||
|
uidNumber: 2001
|
||||||
|
gidNumber: 2001
|
||||||
|
loginShell: /bin/bash
|
||||||
|
homeDirectory: /home/ldapadmin
|
||||||
|
|
||||||
|
03-opencloudadmin.ldif : |-
|
||||||
|
dn: uid=admin,ou=users,dc=opencloud,dc=com
|
||||||
|
objectClass: inetOrgPerson
|
||||||
|
cn: Admin
|
||||||
|
sn: Istrator
|
||||||
|
uid: admin
|
||||||
|
userPassword: {SSHA}HMWJO7XCw80he2lqMf0PHzvvF14p6aLE
|
||||||
|
mail: morgane.roques@irt-saintexupery.com
|
||||||
|
ou: users
|
||||||
|
|
||||||
|
dn: ou=AppRoles,dc=opencloud,dc=com
|
||||||
|
objectClass: organizationalunit
|
||||||
|
ou: AppRoles
|
||||||
|
description: AppRoles
|
||||||
|
|
||||||
|
dn: ou=Opencloud,ou=AppRoles,dc=opencloud,dc=com
|
||||||
|
objectClass: organizationalunit
|
||||||
|
ou: Opencloud
|
||||||
|
description: Opencloud
|
||||||
|
|
||||||
|
prometheus:
|
||||||
|
enabled: true
|
||||||
|
enableTraefikProxyIntegration: true
|
||||||
|
server:
|
||||||
|
persistentVolume:
|
||||||
|
enabled: true
|
||||||
|
size: 5Gi
|
||||||
|
service:
|
||||||
|
type: ClusterIP
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
cpu: 500m
|
||||||
|
memory: 512Mi
|
||||||
|
requests:
|
||||||
|
cpu: 128m
|
||||||
|
memory: 256Mi
|
||||||
|
|
||||||
|
# ldap user manager configuration
|
||||||
|
ldapUserManager:
|
||||||
|
enabled: true
|
||||||
|
env:
|
||||||
|
SERVER_HOSTNAME: ldap.opencloud.com
|
||||||
|
LDAP_BASE_DN: dc=opencloud,dc=com
|
||||||
|
LDAP_REQUIRE_STARTTLS: "false"
|
||||||
|
LDAP_ADMINS_GROUP: ldapadmin
|
||||||
|
LDAP_ADMIN_BIND_DN: cn=admin,dc=opencloud,dc=com
|
||||||
|
LDAP_ADMIN_BIND_PWD: "{SSHA}HMWJO7XCw80he2lqMf0PHzvvF14p6aLE"
|
||||||
|
LDAP_IGNORE_CERT_ERRORS: "true"
|
||||||
|
EMAIL_DOMAIN: ""
|
||||||
|
NO_HTTPS: "true"
|
||||||
|
SERVER_PATH: "/users"
|
||||||
|
ORGANISATION_NAME: Opencloud
|
||||||
|
LDAP_USER_OU: users
|
||||||
|
LDAP_GROUP_OU: groups
|
||||||
|
ACCEPT_WEAK_PASSWORDS: "true"
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
cpu: 128m
|
||||||
|
memory: 256Mi
|
||||||
|
requests:
|
||||||
|
cpu: 128m
|
||||||
|
memory: 256Mi
|
||||||
|
|
||||||
|
traefik:
|
||||||
|
enabled: true
|
||||||
|
service:
|
||||||
|
type: NodePort
|
||||||
|
ports:
|
||||||
|
web:
|
||||||
|
port: 80
|
||||||
|
nodePort: 30950
|
||||||
|
websecure:
|
||||||
|
port: 443
|
||||||
|
nodePort: 30951
|
||||||
|
ingressRoute:
|
||||||
|
dashboard:
|
||||||
|
enabled: true
|
||||||
|
matchRule: Host(`localhost`) && PathPrefix(`/api`) || PathPrefix(`/dashboard`)
|
||||||
|
entryPoints: [web]
|
||||||
|
ports:
|
||||||
|
web:
|
||||||
|
port: 80
|
||||||
|
nodePort: 30950
|
||||||
|
websecure:
|
||||||
|
port: 443
|
||||||
|
nodePort: 30951
|
||||||
|
|
||||||
|
hydra:
|
||||||
|
enabled: true
|
||||||
|
maester:
|
||||||
|
enabled: true
|
||||||
|
secret:
|
||||||
|
enabled: false
|
||||||
|
nameOverride: hydra-secret
|
||||||
|
hashSumEnabled: false
|
||||||
|
hydra:
|
||||||
|
dev: true
|
||||||
|
existingSecret: hydra-secret
|
||||||
|
config:
|
||||||
|
dsn: memory
|
||||||
|
urls:
|
||||||
|
# login: https://localhost-login/authentication/login
|
||||||
|
# consent: https://localhost-consent/consent/consent
|
||||||
|
# logout: https://localhost-logout/authentication/logout
|
||||||
|
self:
|
||||||
|
issuer: "http://cluster-1-hydra-public.cluster-1:4444/"
|
||||||
|
|
||||||
|
keto:
|
||||||
|
enabled: true
|
||||||
|
keto:
|
||||||
|
config:
|
||||||
|
serve:
|
||||||
|
read:
|
||||||
|
port: 4466
|
||||||
|
write:
|
||||||
|
port: 4467
|
||||||
|
metrics:
|
||||||
|
port: 4468
|
||||||
|
namespaces:
|
||||||
|
- id: 0
|
||||||
|
name: open-cloud
|
||||||
|
dsn: memory
|
||||||
|
|
||||||
|
|
||||||
|
loki:
|
||||||
|
enabled: true
|
||||||
|
loki:
|
||||||
|
auth_enabled: false
|
||||||
|
commonConfig:
|
||||||
|
replication_factor: 1
|
||||||
|
storage:
|
||||||
|
storageClassName: standard
|
||||||
|
type: filesystem
|
||||||
|
filesystem:
|
||||||
|
chunks_directory: /var/loki/chunks
|
||||||
|
rules_directory: /var/loki/rules
|
||||||
|
admin_api_directory: /var/loki/admin
|
||||||
|
storage_config:
|
||||||
|
boltdb_shipper:
|
||||||
|
active_index_directory: /var/loki/index
|
||||||
|
filesystem:
|
||||||
|
directory: /var/loki/chunks
|
||||||
|
limits_config:
|
||||||
|
allow_structured_metadata: false
|
||||||
|
schemaConfig:
|
||||||
|
configs:
|
||||||
|
- from: "2020-01-01"
|
||||||
|
store: boltdb-shipper
|
||||||
|
object_store: filesystem
|
||||||
|
schema: v11
|
||||||
|
index:
|
||||||
|
prefix: index_
|
||||||
|
period: 24h
|
||||||
|
ingester:
|
||||||
|
chunk_encoding: snappy
|
||||||
|
tracing:
|
||||||
|
enabled: true
|
||||||
|
querier:
|
||||||
|
max_concurrent: 2
|
||||||
|
|
||||||
|
deploymentMode: SingleBinary
|
||||||
|
singleBinary:
|
||||||
|
extraVolumes:
|
||||||
|
- name: loki-storage
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: loki-pvc
|
||||||
|
persistence:
|
||||||
|
enabled: false # Deactivate loki auto provisioning, rely on existing PVC
|
||||||
|
accessMode: ReadWriteOnce
|
||||||
|
size: 1Gi
|
||||||
|
storageClassName: standard
|
||||||
|
create: false
|
||||||
|
claimName: loki-pvc
|
||||||
|
|
||||||
|
extraVolumeMounts:
|
||||||
|
- name: loki-storage
|
||||||
|
mountPath: /var/loki
|
||||||
|
replicas: 1
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
cpu: 3
|
||||||
|
memory: 4Gi
|
||||||
|
requests:
|
||||||
|
cpu: 1
|
||||||
|
memory: 0.5Gi
|
||||||
|
extraEnv:
|
||||||
|
- name: GOMEMLIMIT
|
||||||
|
value: 3750MiB
|
||||||
|
|
||||||
|
chunksCache:
|
||||||
|
# default is 500MB, with limited memory keep this smaller
|
||||||
|
writebackSizeLimit: 10MB
|
||||||
|
|
||||||
|
# Enable minio for storage
|
||||||
|
minio:
|
||||||
|
enabled: false
|
||||||
|
# Zero out replica counts of other deployment modes
|
||||||
|
backend:
|
||||||
|
replicas: 0
|
||||||
|
read:
|
||||||
|
replicas: 0
|
||||||
|
write:
|
||||||
|
replicas: 0
|
||||||
|
ingester:
|
||||||
|
replicas: 0
|
||||||
|
querier:
|
||||||
|
replicas: 0
|
||||||
|
queryFrontend:
|
||||||
|
replicas: 0
|
||||||
|
queryScheduler:
|
||||||
|
replicas: 0
|
||||||
|
distributor:
|
||||||
|
replicas: 0
|
||||||
|
compactor:
|
||||||
|
replicas: 0
|
||||||
|
indexGateway:
|
||||||
|
replicas: 0
|
||||||
|
bloomCompactor:
|
||||||
|
replicas: 0
|
||||||
|
bloomGateway:
|
||||||
|
replicas: 0
|
||||||
|
|
||||||
|
grafana:
|
||||||
|
enabled: true
|
||||||
|
adminUser: admin
|
||||||
|
adminPassword: admin
|
||||||
|
persistence:
|
||||||
|
enabled: true
|
||||||
|
size: 1Gi
|
||||||
|
service:
|
||||||
|
type: ClusterIP
|
||||||
|
|
||||||
|
argo-workflows:
|
||||||
|
enabled: false
|
||||||
|
workflow:
|
||||||
|
serviceAccount:
|
||||||
|
create: false
|
||||||
|
name: argo-workflow
|
||||||
|
rbac:
|
||||||
|
create: false # Manual provisioning
|
||||||
|
controller:
|
||||||
|
workflowNamespaces: [] #All of them
|
||||||
|
controller:
|
||||||
|
workflowDefaults:
|
||||||
|
spec:
|
||||||
|
serviceAccountName: argo-workflow
|
||||||
|
|
||||||
|
ocAuth:
|
||||||
|
enabled: true
|
||||||
|
enableTraefikProxyIntegration: true
|
||||||
|
image: opencloudregistry/oc-auth:latest
|
||||||
|
authType: hydra
|
||||||
|
keto:
|
||||||
|
adminRole: admin
|
||||||
|
hydra:
|
||||||
|
openCloudOauth2ClientSecretName: opencloud-oauth2-client-secret
|
||||||
|
ldap:
|
||||||
|
bindDn: cn=admin,dc=opencloud,dc=com
|
||||||
|
binPwd: admin
|
||||||
|
baseDn: dc=opencloud,dc=com
|
||||||
|
userBaseDn: ou=users,dc=opencloud,dc=com
|
||||||
|
roleBaseDn: ou=AppRoles,dc=opencloud,dc=com
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
cpu: 128m
|
||||||
|
memory: 256Mi
|
||||||
|
requests:
|
||||||
|
cpu: 128m
|
||||||
|
memory: 256Mi
|
||||||
|
replicas: 1
|
||||||
|
hpa:
|
||||||
|
enabled: true
|
||||||
|
minReplicas: 1
|
||||||
|
maxReplicas: 5
|
||||||
|
targetCPUUtilizationPercentage: 80
|
||||||
|
|
||||||
|
ocFront:
|
||||||
|
enabled: true
|
||||||
|
enableTraefikProxyIntegration: true
|
||||||
|
image: opencloudregistry/oc-front:latest
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
cpu: 128m
|
||||||
|
memory: 256Mi
|
||||||
|
requests:
|
||||||
|
cpu: 128m
|
||||||
|
memory: 256Mi
|
||||||
|
replicas: 1
|
||||||
|
hpa:
|
||||||
|
enabled: true
|
||||||
|
minReplicas: 1
|
||||||
|
maxReplicas: 5
|
||||||
|
targetCPUUtilizationPercentage: 80
|
||||||
|
|
||||||
|
ocWorkspace:
|
||||||
|
enabled: true
|
||||||
|
enableTraefikProxyIntegration: true
|
||||||
|
image: opencloudregistry/oc-workspace:latest
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
cpu: 128m
|
||||||
|
memory: 256Mi
|
||||||
|
requests:
|
||||||
|
cpu: 128m
|
||||||
|
memory: 256Mi
|
||||||
|
replicas: 1
|
||||||
|
hpa:
|
||||||
|
enabled: true
|
||||||
|
minReplicas: 1
|
||||||
|
maxReplicas: 5
|
||||||
|
targetCPUUtilizationPercentage: 80
|
||||||
|
|
||||||
|
|
||||||
|
ocShared:
|
||||||
|
enabled: true
|
||||||
|
enableTraefikProxyIntegration: true
|
||||||
|
image: opencloudregistry/oc-shared:latest
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
cpu: 128m
|
||||||
|
memory: 256Mi
|
||||||
|
requests:
|
||||||
|
cpu: 128m
|
||||||
|
memory: 256Mi
|
||||||
|
replicas: 1
|
||||||
|
hpa:
|
||||||
|
enabled: true
|
||||||
|
minReplicas: 1
|
||||||
|
maxReplicas: 5
|
||||||
|
targetCPUUtilizationPercentage: 80
|
||||||
|
|
||||||
|
ocWorkflow:
|
||||||
|
enabled: true
|
||||||
|
enableTraefikProxyIntegration: true
|
||||||
|
image: opencloudregistry/oc-workflow:latest
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
cpu: 128m
|
||||||
|
memory: 256Mi
|
||||||
|
requests:
|
||||||
|
cpu: 128m
|
||||||
|
memory: 256Mi
|
||||||
|
replicas: 1
|
||||||
|
hpa:
|
||||||
|
enabled: true
|
||||||
|
minReplicas: 1
|
||||||
|
maxReplicas: 5
|
||||||
|
targetCPUUtilizationPercentage: 80
|
||||||
|
|
||||||
|
ocCatalog:
|
||||||
|
enabled: true
|
||||||
|
enableTraefikProxyIntegration: true
|
||||||
|
image: opencloudregistry/oc-catalog:latest
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
cpu: 128m
|
||||||
|
memory: 256Mi
|
||||||
|
requests:
|
||||||
|
cpu: 128m
|
||||||
|
memory: 256Mi
|
||||||
|
replicas: 1
|
||||||
|
hpa:
|
||||||
|
enabled: true
|
||||||
|
minReplicas: 1
|
||||||
|
maxReplicas: 5
|
||||||
|
targetCPUUtilizationPercentage: 80
|
||||||
|
|
||||||
|
ocPeer:
|
||||||
|
enabled: true
|
||||||
|
enableTraefikProxyIntegration: true
|
||||||
|
image: opencloudregistry/oc-peer:latest
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
cpu: 128m
|
||||||
|
memory: 256Mi
|
||||||
|
requests:
|
||||||
|
cpu: 128m
|
||||||
|
memory: 256Mi
|
||||||
|
replicas: 1
|
||||||
|
hpa:
|
||||||
|
enabled: true
|
||||||
|
minReplicas: 1
|
||||||
|
maxReplicas: 5
|
||||||
|
targetCPUUtilizationPercentage: 80
|
||||||
|
|
||||||
|
ocDatacenter:
|
||||||
|
enabled: true
|
||||||
|
enableTraefikProxyIntegration: true
|
||||||
|
image: opencloudregistry/oc-datacenter:latest
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
cpu: 128m
|
||||||
|
memory: 256Mi
|
||||||
|
requests:
|
||||||
|
cpu: 128m
|
||||||
|
memory: 256Mi
|
||||||
|
replicas: 1
|
||||||
|
hpa:
|
||||||
|
enabled: true
|
||||||
|
minReplicas: 1
|
||||||
|
maxReplicas: 5
|
||||||
|
targetCPUUtilizationPercentage: 80
|
||||||
|
|
||||||
|
ocDiscovery:
|
||||||
|
enabled: true
|
||||||
|
enableTraefikProxyIntegration: true
|
||||||
|
image: opencloudregistry/oc-schedulerd:latest
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
cpu: 128m
|
||||||
|
memory: 256Mi
|
||||||
|
requests:
|
||||||
|
cpu: 128m
|
||||||
|
memory: 256Mi
|
||||||
|
replicas: 1
|
||||||
|
hpa:
|
||||||
|
enabled: true
|
||||||
|
minReplicas: 1
|
||||||
|
maxReplicas: 5
|
||||||
|
targetCPUUtilizationPercentage: 80
|
||||||
|
|
||||||
|
ocSchedulerd:
|
||||||
|
enabled: true
|
||||||
|
enableTraefikProxyIntegration: true
|
||||||
|
image: opencloudregistry/oc-schedulerd:latest
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
cpu: 128m
|
||||||
|
memory: 256Mi
|
||||||
|
requests:
|
||||||
|
cpu: 128m
|
||||||
|
memory: 256Mi
|
||||||
|
replicas: 1
|
||||||
|
hpa:
|
||||||
|
enabled: true
|
||||||
|
minReplicas: 1
|
||||||
|
maxReplicas: 5
|
||||||
|
targetCPUUtilizationPercentage: 80
|
||||||
|
|
||||||
|
ocScheduler:
|
||||||
|
enabled: true
|
||||||
|
enableTraefikProxyIntegration: true
|
||||||
|
image: opencloudregistry/oc-scheduler:latest
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
cpu: 128m
|
||||||
|
memory: 256Mi
|
||||||
|
requests:
|
||||||
|
cpu: 128m
|
||||||
|
memory: 256Mi
|
||||||
|
replicas: 1
|
||||||
|
hpa:
|
||||||
|
enabled: true
|
||||||
|
minReplicas: 1
|
||||||
|
maxReplicas: 5
|
||||||
|
targetCPUUtilizationPercentage: 80
|
||||||
|
|
||||||
|
docker-registry-ui:
|
||||||
|
enabled: true
|
||||||
|
ui:
|
||||||
|
title: "opencloud docker registry"
|
||||||
|
proxy: true
|
||||||
|
dockerRegistryUrl: "http://cluster-1-docker-registry-ui-registry-server.cluster-1.svc.cluster.local:5000"
|
||||||
|
registry:
|
||||||
|
secretName: regcred
|
||||||
|
enabled: true
|
||||||
|
dataVolume:
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: docker-registry-pvc
|
||||||
|
persistence:
|
||||||
|
create: false
|
||||||
|
existingClaim: docker-registry-pvc
|
||||||
|
accessMode: ReadWriteOnce
|
||||||
|
storage: 5Gi
|
||||||
|
storageClassName: "standard"
|
||||||
656
k8s/cluster-2-values.yaml
Normal file
656
k8s/cluster-2-values.yaml
Normal file
@@ -0,0 +1,656 @@
|
|||||||
|
env: cluster-2 # For storage class provisioning
|
||||||
|
clusterName: cluster-2
|
||||||
|
hostNetwork: true
|
||||||
|
host: beta.opencloud.com
|
||||||
|
hostPort: 9700
|
||||||
|
registryHost: opencloudregistry
|
||||||
|
scheme: http
|
||||||
|
|
||||||
|
secrets:
|
||||||
|
keys:
|
||||||
|
enabled: true
|
||||||
|
name: libp2p-keys
|
||||||
|
mountPath: ./pem
|
||||||
|
psk:
|
||||||
|
enabled: true
|
||||||
|
name: libp2p-psk
|
||||||
|
mountPath: ./psk
|
||||||
|
|
||||||
|
mongo-express:
|
||||||
|
enabled: true
|
||||||
|
mongodbServer: "cluster-2-mongodb.cluster-2" # TO LOOK AFTER
|
||||||
|
mongodbPort: 27017
|
||||||
|
mongodbEnableAdmin: true
|
||||||
|
mongodbAdminUsername: admin
|
||||||
|
mongodbAdminPassword: admin
|
||||||
|
siteBaseUrl: /mongoexpress
|
||||||
|
basicAuthUsername: admin
|
||||||
|
basicAuthPassword: admin
|
||||||
|
mongodb:
|
||||||
|
enabled: false
|
||||||
|
|
||||||
|
mongodb:
|
||||||
|
enabled: true
|
||||||
|
global:
|
||||||
|
defaultStorageClass: "standard"
|
||||||
|
storageClass: "standard"
|
||||||
|
architecture: standalone
|
||||||
|
useStatefulSet: false
|
||||||
|
auth:
|
||||||
|
enabled: true
|
||||||
|
rootUser: admin
|
||||||
|
rootPassword: admin
|
||||||
|
databases: [ opencloud ]
|
||||||
|
usernames: [ admin ]
|
||||||
|
passwords: [ admin ]
|
||||||
|
resourcesPreset: "small"
|
||||||
|
replicaCount: 1
|
||||||
|
persistence:
|
||||||
|
enabled: true
|
||||||
|
create: false # do not auto-create
|
||||||
|
existingClaim: mongo-pvc
|
||||||
|
storageClassName: "standard"
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
size: 5Gi
|
||||||
|
persistentVolumeClaimRetentionPolicy:
|
||||||
|
enabled: true
|
||||||
|
whenDeleted: Retain
|
||||||
|
whenScaled: Retain
|
||||||
|
arbiter:
|
||||||
|
enabled: false
|
||||||
|
livenessProbe:
|
||||||
|
enabled: true
|
||||||
|
readinessProbe:
|
||||||
|
enabled: true
|
||||||
|
|
||||||
|
nats:
|
||||||
|
enabled: true
|
||||||
|
extraEnv:
|
||||||
|
- name: NATS_MAX_FILE_DESCRIPTORS
|
||||||
|
value: "65536"
|
||||||
|
extraVolumeMounts:
|
||||||
|
- name: nats-config
|
||||||
|
mountPath: /etc/nats
|
||||||
|
config:
|
||||||
|
jetstream:
|
||||||
|
enabled: true
|
||||||
|
fileStore:
|
||||||
|
enabled: true
|
||||||
|
dir: /data/jetstream # mountPath used by template
|
||||||
|
# pvc block must live here
|
||||||
|
pvc:
|
||||||
|
enabled: true
|
||||||
|
# if you already created the claim, set existingClaim:
|
||||||
|
existingClaim: nats-pvc
|
||||||
|
# storageClassName: local-path or standard (use the SC in your cluster)
|
||||||
|
storageClassName: standard
|
||||||
|
size: 50Gi
|
||||||
|
# name is the volume name used in volumeMounts; keep it simple
|
||||||
|
name: nats-jetstream
|
||||||
|
|
||||||
|
openldap:
|
||||||
|
enabled: true
|
||||||
|
test:
|
||||||
|
enabled: false
|
||||||
|
ltb-passwd:
|
||||||
|
enabled: false
|
||||||
|
replicaCount: 1
|
||||||
|
image:
|
||||||
|
repository: osixia/openldap
|
||||||
|
tls:
|
||||||
|
enabled: false
|
||||||
|
env:
|
||||||
|
LDAP_ORGANISATION: Opencloud
|
||||||
|
LDAP_DOMAIN: opencloud.com
|
||||||
|
LDAP_BACKEND: "mdb"
|
||||||
|
LDAP_TLS: "false"
|
||||||
|
LDAP_TLS_ENFORCE: "false"
|
||||||
|
LDAP_REMOVE_CONFIG_AFTER_SETUP: "true"
|
||||||
|
adminPassword: admin
|
||||||
|
configPassword: configadmin
|
||||||
|
phpldapadmin:
|
||||||
|
enabled: false
|
||||||
|
persistence:
|
||||||
|
enabled: true
|
||||||
|
create: false # do not auto-create
|
||||||
|
existingClaim: openldap-pvc
|
||||||
|
accessMode: ReadWriteOnce
|
||||||
|
size: 10Mi
|
||||||
|
storageClassName: ""
|
||||||
|
replication:
|
||||||
|
enabled: false
|
||||||
|
externalLDAP:
|
||||||
|
enabled: false
|
||||||
|
url: 389
|
||||||
|
bindDN: uid=admin,dc=opencloud,dc=com
|
||||||
|
bindPassword: admin
|
||||||
|
customLdifFiles:
|
||||||
|
01-schema.ldif: |-
|
||||||
|
dn: ou=groups,dc=opencloud,dc=com
|
||||||
|
objectClass: organizationalUnit
|
||||||
|
ou: groups
|
||||||
|
|
||||||
|
dn: ou=users,dc=opencloud,dc=com
|
||||||
|
objectClass: organizationalUnit
|
||||||
|
ou: users
|
||||||
|
|
||||||
|
dn: cn=lastGID,dc=opencloud,dc=com
|
||||||
|
objectClass: device
|
||||||
|
objectClass: top
|
||||||
|
description: Records the last GID used to create a Posix group. This prevents the re-use of a GID from a deleted group.
|
||||||
|
cn: lastGID
|
||||||
|
serialNumber: 2001
|
||||||
|
|
||||||
|
dn: cn=lastUID,dc=opencloud,dc=com
|
||||||
|
objectClass: device
|
||||||
|
objectClass: top
|
||||||
|
serialNumber: 2001
|
||||||
|
description: Records the last UID used to create a Posix account. This prevents the re-use of a UID from a deleted account.
|
||||||
|
cn: lastUID
|
||||||
|
|
||||||
|
dn: cn=everybody,ou=groups,dc=opencloud,dc=com
|
||||||
|
objectClass: top
|
||||||
|
objectClass: posixGroup
|
||||||
|
cn: everybody
|
||||||
|
memberUid: admin
|
||||||
|
gidNumber: 2003
|
||||||
|
|
||||||
|
02-ldapadmin.ldif : |-
|
||||||
|
dn: cn=ldapadmin,ou=groups,dc=opencloud,dc=com
|
||||||
|
objectClass: top
|
||||||
|
objectClass: posixGroup
|
||||||
|
cn: ldapadmin
|
||||||
|
memberUid: ldapadmin
|
||||||
|
gidNumber: 2001
|
||||||
|
|
||||||
|
dn: uid=ldapadmin,ou=users,dc=opencloud,dc=com
|
||||||
|
givenName: ldap
|
||||||
|
sn: admin
|
||||||
|
uid: ldapadmin
|
||||||
|
cn: ldapadmin
|
||||||
|
mail: ldapadmin@example.com
|
||||||
|
objectClass: person
|
||||||
|
objectClass: inetOrgPerson
|
||||||
|
objectClass: posixAccount
|
||||||
|
userPassword: sai1yeiT
|
||||||
|
uidNumber: 2001
|
||||||
|
gidNumber: 2001
|
||||||
|
loginShell: /bin/bash
|
||||||
|
homeDirectory: /home/ldapadmin
|
||||||
|
|
||||||
|
03-opencloudadmin.ldif : |-
|
||||||
|
dn: uid=admin,ou=users,dc=opencloud,dc=com
|
||||||
|
objectClass: inetOrgPerson
|
||||||
|
cn: Admin
|
||||||
|
sn: Istrator
|
||||||
|
uid: admin
|
||||||
|
userPassword: {SSHA}HMWJO7XCw80he2lqMf0PHzvvF14p6aLE
|
||||||
|
mail: morgane.roques@irt-saintexupery.com
|
||||||
|
ou: users
|
||||||
|
|
||||||
|
dn: ou=AppRoles,dc=opencloud,dc=com
|
||||||
|
objectClass: organizationalunit
|
||||||
|
ou: AppRoles
|
||||||
|
description: AppRoles
|
||||||
|
|
||||||
|
dn: ou=Opencloud,ou=AppRoles,dc=opencloud,dc=com
|
||||||
|
objectClass: organizationalunit
|
||||||
|
ou: Opencloud
|
||||||
|
description: Opencloud
|
||||||
|
|
||||||
|
prometheus:
|
||||||
|
enabled: true
|
||||||
|
enableTraefikProxyIntegration: true
|
||||||
|
server:
|
||||||
|
persistentVolume:
|
||||||
|
enabled: true
|
||||||
|
size: 5Gi
|
||||||
|
service:
|
||||||
|
type: ClusterIP
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
cpu: 500m
|
||||||
|
memory: 512Mi
|
||||||
|
requests:
|
||||||
|
cpu: 128m
|
||||||
|
memory: 256Mi
|
||||||
|
|
||||||
|
# ldap user manager configuration
|
||||||
|
ldapUserManager:
|
||||||
|
enabled: true
|
||||||
|
env:
|
||||||
|
SERVER_HOSTNAME: ldap.opencloud.com
|
||||||
|
LDAP_BASE_DN: dc=opencloud,dc=com
|
||||||
|
LDAP_REQUIRE_STARTTLS: "false"
|
||||||
|
LDAP_ADMINS_GROUP: ldapadmin
|
||||||
|
LDAP_ADMIN_BIND_DN: cn=admin,dc=opencloud,dc=com
|
||||||
|
LDAP_ADMIN_BIND_PWD: "{SSHA}HMWJO7XCw80he2lqMf0PHzvvF14p6aLE"
|
||||||
|
LDAP_IGNORE_CERT_ERRORS: "true"
|
||||||
|
EMAIL_DOMAIN: ""
|
||||||
|
NO_HTTPS: "true"
|
||||||
|
SERVER_PATH: "/users"
|
||||||
|
ORGANISATION_NAME: Opencloud
|
||||||
|
LDAP_USER_OU: users
|
||||||
|
LDAP_GROUP_OU: groups
|
||||||
|
ACCEPT_WEAK_PASSWORDS: "true"
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
cpu: 128m
|
||||||
|
memory: 256Mi
|
||||||
|
requests:
|
||||||
|
cpu: 128m
|
||||||
|
memory: 256Mi
|
||||||
|
|
||||||
|
traefik:
|
||||||
|
enabled: true
|
||||||
|
service:
|
||||||
|
type: NodePort
|
||||||
|
ports:
|
||||||
|
web:
|
||||||
|
port: 80
|
||||||
|
nodePort: 30950
|
||||||
|
websecure:
|
||||||
|
port: 443
|
||||||
|
nodePort: 30951
|
||||||
|
ingressRoute:
|
||||||
|
dashboard:
|
||||||
|
enabled: true
|
||||||
|
matchRule: Host(`localhost`) && PathPrefix(`/api`) || PathPrefix(`/dashboard`)
|
||||||
|
entryPoints: [web]
|
||||||
|
ports:
|
||||||
|
web:
|
||||||
|
port: 80
|
||||||
|
nodePort: 30950
|
||||||
|
websecure:
|
||||||
|
port: 443
|
||||||
|
nodePort: 30951
|
||||||
|
|
||||||
|
hydra:
|
||||||
|
enabled: true
|
||||||
|
maester:
|
||||||
|
enabled: true
|
||||||
|
secret:
|
||||||
|
enabled: false
|
||||||
|
nameOverride: hydra-secret
|
||||||
|
hashSumEnabled: false
|
||||||
|
hydra:
|
||||||
|
dev: true
|
||||||
|
existingSecret: hydra-secret
|
||||||
|
config:
|
||||||
|
dsn: memory
|
||||||
|
urls:
|
||||||
|
# login: https://localhost-login/authentication/login
|
||||||
|
# consent: https://localhost-consent/consent/consent
|
||||||
|
# logout: https://localhost-logout/authentication/logout
|
||||||
|
self:
|
||||||
|
issuer: "http://cluster-2-hydra-public.cluster-2:4444/"
|
||||||
|
|
||||||
|
keto:
|
||||||
|
enabled: true
|
||||||
|
keto:
|
||||||
|
config:
|
||||||
|
serve:
|
||||||
|
read:
|
||||||
|
port: 4466
|
||||||
|
write:
|
||||||
|
port: 4467
|
||||||
|
metrics:
|
||||||
|
port: 4468
|
||||||
|
namespaces:
|
||||||
|
- id: 0
|
||||||
|
name: open-cloud
|
||||||
|
dsn: memory
|
||||||
|
|
||||||
|
|
||||||
|
loki:
|
||||||
|
enabled: true
|
||||||
|
loki:
|
||||||
|
auth_enabled: false
|
||||||
|
commonConfig:
|
||||||
|
replication_factor: 1
|
||||||
|
storage:
|
||||||
|
storageClassName: standard
|
||||||
|
type: filesystem
|
||||||
|
filesystem:
|
||||||
|
chunks_directory: /var/loki/chunks
|
||||||
|
rules_directory: /var/loki/rules
|
||||||
|
admin_api_directory: /var/loki/admin
|
||||||
|
storage_config:
|
||||||
|
boltdb_shipper:
|
||||||
|
active_index_directory: /var/loki/index
|
||||||
|
filesystem:
|
||||||
|
directory: /var/loki/chunks
|
||||||
|
limits_config:
|
||||||
|
allow_structured_metadata: false
|
||||||
|
schemaConfig:
|
||||||
|
configs:
|
||||||
|
- from: "2020-01-01"
|
||||||
|
store: boltdb-shipper
|
||||||
|
object_store: filesystem
|
||||||
|
schema: v11
|
||||||
|
index:
|
||||||
|
prefix: index_
|
||||||
|
period: 24h
|
||||||
|
ingester:
|
||||||
|
chunk_encoding: snappy
|
||||||
|
tracing:
|
||||||
|
enabled: true
|
||||||
|
querier:
|
||||||
|
max_concurrent: 2
|
||||||
|
|
||||||
|
deploymentMode: SingleBinary
|
||||||
|
singleBinary:
|
||||||
|
extraVolumes:
|
||||||
|
- name: loki-storage
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: loki-pvc
|
||||||
|
persistence:
|
||||||
|
enabled: false # Deactivate loki auto provisioning, rely on existing PVC
|
||||||
|
accessMode: ReadWriteOnce
|
||||||
|
size: 1Gi
|
||||||
|
storageClassName: standard
|
||||||
|
create: false
|
||||||
|
claimName: loki-pvc
|
||||||
|
|
||||||
|
extraVolumeMounts:
|
||||||
|
- name: loki-storage
|
||||||
|
mountPath: /var/loki
|
||||||
|
replicas: 1
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
cpu: 3
|
||||||
|
memory: 4Gi
|
||||||
|
requests:
|
||||||
|
cpu: 1
|
||||||
|
memory: 0.5Gi
|
||||||
|
extraEnv:
|
||||||
|
- name: GOMEMLIMIT
|
||||||
|
value: 3750MiB
|
||||||
|
|
||||||
|
chunksCache:
|
||||||
|
# default is 500MB, with limited memory keep this smaller
|
||||||
|
writebackSizeLimit: 10MB
|
||||||
|
|
||||||
|
# Enable minio for storage
|
||||||
|
minio:
|
||||||
|
enabled: false
|
||||||
|
# Zero out replica counts of other deployment modes
|
||||||
|
backend:
|
||||||
|
replicas: 0
|
||||||
|
read:
|
||||||
|
replicas: 0
|
||||||
|
write:
|
||||||
|
replicas: 0
|
||||||
|
ingester:
|
||||||
|
replicas: 0
|
||||||
|
querier:
|
||||||
|
replicas: 0
|
||||||
|
queryFrontend:
|
||||||
|
replicas: 0
|
||||||
|
queryScheduler:
|
||||||
|
replicas: 0
|
||||||
|
distributor:
|
||||||
|
replicas: 0
|
||||||
|
compactor:
|
||||||
|
replicas: 0
|
||||||
|
indexGateway:
|
||||||
|
replicas: 0
|
||||||
|
bloomCompactor:
|
||||||
|
replicas: 0
|
||||||
|
bloomGateway:
|
||||||
|
replicas: 0
|
||||||
|
|
||||||
|
grafana:
|
||||||
|
enabled: true
|
||||||
|
adminUser: admin
|
||||||
|
adminPassword: admin
|
||||||
|
persistence:
|
||||||
|
enabled: true
|
||||||
|
size: 1Gi
|
||||||
|
service:
|
||||||
|
type: ClusterIP
|
||||||
|
|
||||||
|
argo-workflows:
|
||||||
|
enabled: false
|
||||||
|
workflow:
|
||||||
|
serviceAccount:
|
||||||
|
create: false
|
||||||
|
name: argo-workflow
|
||||||
|
rbac:
|
||||||
|
create: false # Manual provisioning
|
||||||
|
controller:
|
||||||
|
workflowNamespaces: [] #All of them
|
||||||
|
controller:
|
||||||
|
workflowDefaults:
|
||||||
|
spec:
|
||||||
|
serviceAccountName: argo-workflow
|
||||||
|
|
||||||
|
ocAuth:
|
||||||
|
enabled: true
|
||||||
|
enableTraefikProxyIntegration: true
|
||||||
|
image: opencloudregistry/oc-auth:latest
|
||||||
|
authType: hydra
|
||||||
|
keto:
|
||||||
|
adminRole: admin
|
||||||
|
hydra:
|
||||||
|
openCloudOauth2ClientSecretName: opencloud-oauth2-client-secret
|
||||||
|
ldap:
|
||||||
|
bindDn: cn=admin,dc=opencloud,dc=com
|
||||||
|
binPwd: admin
|
||||||
|
baseDn: dc=opencloud,dc=com
|
||||||
|
userBaseDn: ou=users,dc=opencloud,dc=com
|
||||||
|
roleBaseDn: ou=AppRoles,dc=opencloud,dc=com
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
cpu: 128m
|
||||||
|
memory: 256Mi
|
||||||
|
requests:
|
||||||
|
cpu: 128m
|
||||||
|
memory: 256Mi
|
||||||
|
replicas: 1
|
||||||
|
hpa:
|
||||||
|
enabled: true
|
||||||
|
minReplicas: 1
|
||||||
|
maxReplicas: 5
|
||||||
|
targetCPUUtilizationPercentage: 80
|
||||||
|
|
||||||
|
ocFront:
|
||||||
|
enabled: true
|
||||||
|
enableTraefikProxyIntegration: true
|
||||||
|
image: opencloudregistry/oc-front:latest
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
cpu: 128m
|
||||||
|
memory: 256Mi
|
||||||
|
requests:
|
||||||
|
cpu: 128m
|
||||||
|
memory: 256Mi
|
||||||
|
replicas: 1
|
||||||
|
hpa:
|
||||||
|
enabled: true
|
||||||
|
minReplicas: 1
|
||||||
|
maxReplicas: 5
|
||||||
|
targetCPUUtilizationPercentage: 80
|
||||||
|
|
||||||
|
ocWorkspace:
|
||||||
|
enabled: true
|
||||||
|
enableTraefikProxyIntegration: true
|
||||||
|
image: opencloudregistry/oc-workspace:latest
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
cpu: 128m
|
||||||
|
memory: 256Mi
|
||||||
|
requests:
|
||||||
|
cpu: 128m
|
||||||
|
memory: 256Mi
|
||||||
|
replicas: 1
|
||||||
|
hpa:
|
||||||
|
enabled: true
|
||||||
|
minReplicas: 1
|
||||||
|
maxReplicas: 5
|
||||||
|
targetCPUUtilizationPercentage: 80
|
||||||
|
|
||||||
|
|
||||||
|
ocShared:
|
||||||
|
enabled: true
|
||||||
|
enableTraefikProxyIntegration: true
|
||||||
|
image: opencloudregistry/oc-shared:latest
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
cpu: 128m
|
||||||
|
memory: 256Mi
|
||||||
|
requests:
|
||||||
|
cpu: 128m
|
||||||
|
memory: 256Mi
|
||||||
|
replicas: 1
|
||||||
|
hpa:
|
||||||
|
enabled: true
|
||||||
|
minReplicas: 1
|
||||||
|
maxReplicas: 5
|
||||||
|
targetCPUUtilizationPercentage: 80
|
||||||
|
|
||||||
|
ocWorkflow:
|
||||||
|
enabled: true
|
||||||
|
enableTraefikProxyIntegration: true
|
||||||
|
image: opencloudregistry/oc-workflow:latest
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
cpu: 128m
|
||||||
|
memory: 256Mi
|
||||||
|
requests:
|
||||||
|
cpu: 128m
|
||||||
|
memory: 256Mi
|
||||||
|
replicas: 1
|
||||||
|
hpa:
|
||||||
|
enabled: true
|
||||||
|
minReplicas: 1
|
||||||
|
maxReplicas: 5
|
||||||
|
targetCPUUtilizationPercentage: 80
|
||||||
|
|
||||||
|
ocCatalog:
|
||||||
|
enabled: true
|
||||||
|
enableTraefikProxyIntegration: true
|
||||||
|
image: opencloudregistry/oc-catalog:latest
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
cpu: 128m
|
||||||
|
memory: 256Mi
|
||||||
|
requests:
|
||||||
|
cpu: 128m
|
||||||
|
memory: 256Mi
|
||||||
|
replicas: 1
|
||||||
|
hpa:
|
||||||
|
enabled: true
|
||||||
|
minReplicas: 1
|
||||||
|
maxReplicas: 5
|
||||||
|
targetCPUUtilizationPercentage: 80
|
||||||
|
|
||||||
|
ocPeer:
|
||||||
|
enabled: true
|
||||||
|
enableTraefikProxyIntegration: true
|
||||||
|
image: opencloudregistry/oc-peer:latest
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
cpu: 128m
|
||||||
|
memory: 256Mi
|
||||||
|
requests:
|
||||||
|
cpu: 128m
|
||||||
|
memory: 256Mi
|
||||||
|
replicas: 1
|
||||||
|
hpa:
|
||||||
|
enabled: true
|
||||||
|
minReplicas: 1
|
||||||
|
maxReplicas: 5
|
||||||
|
targetCPUUtilizationPercentage: 80
|
||||||
|
|
||||||
|
ocDatacenter:
|
||||||
|
enabled: true
|
||||||
|
enableTraefikProxyIntegration: true
|
||||||
|
image: opencloudregistry/oc-datacenter:latest
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
cpu: 128m
|
||||||
|
memory: 256Mi
|
||||||
|
requests:
|
||||||
|
cpu: 128m
|
||||||
|
memory: 256Mi
|
||||||
|
replicas: 1
|
||||||
|
hpa:
|
||||||
|
enabled: true
|
||||||
|
minReplicas: 1
|
||||||
|
maxReplicas: 5
|
||||||
|
targetCPUUtilizationPercentage: 80
|
||||||
|
|
||||||
|
ocDiscovery:
|
||||||
|
enabled: true
|
||||||
|
enableTraefikProxyIntegration: true
|
||||||
|
image: opencloudregistry/oc-schedulerd:latest
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
cpu: 128m
|
||||||
|
memory: 256Mi
|
||||||
|
requests:
|
||||||
|
cpu: 128m
|
||||||
|
memory: 256Mi
|
||||||
|
replicas: 1
|
||||||
|
hpa:
|
||||||
|
enabled: true
|
||||||
|
minReplicas: 1
|
||||||
|
maxReplicas: 5
|
||||||
|
targetCPUUtilizationPercentage: 80
|
||||||
|
|
||||||
|
ocSchedulerd:
|
||||||
|
enabled: true
|
||||||
|
enableTraefikProxyIntegration: true
|
||||||
|
image: opencloudregistry/oc-schedulerd:latest
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
cpu: 128m
|
||||||
|
memory: 256Mi
|
||||||
|
requests:
|
||||||
|
cpu: 128m
|
||||||
|
memory: 256Mi
|
||||||
|
replicas: 1
|
||||||
|
hpa:
|
||||||
|
enabled: true
|
||||||
|
minReplicas: 1
|
||||||
|
maxReplicas: 5
|
||||||
|
targetCPUUtilizationPercentage: 80
|
||||||
|
|
||||||
|
ocScheduler:
|
||||||
|
enabled: true
|
||||||
|
enableTraefikProxyIntegration: true
|
||||||
|
image: opencloudregistry/oc-scheduler:latest
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
cpu: 128m
|
||||||
|
memory: 256Mi
|
||||||
|
requests:
|
||||||
|
cpu: 128m
|
||||||
|
memory: 256Mi
|
||||||
|
replicas: 1
|
||||||
|
hpa:
|
||||||
|
enabled: true
|
||||||
|
minReplicas: 1
|
||||||
|
maxReplicas: 5
|
||||||
|
targetCPUUtilizationPercentage: 80
|
||||||
|
|
||||||
|
docker-registry-ui:
|
||||||
|
enabled: true
|
||||||
|
ui:
|
||||||
|
title: "opencloud docker registry"
|
||||||
|
proxy: true
|
||||||
|
dockerRegistryUrl: "http://cluster-2-docker-registry-ui-registry-server.cluster-2.svc.cluster.local:5000"
|
||||||
|
registry:
|
||||||
|
secretName: regcred
|
||||||
|
enabled: true
|
||||||
|
dataVolume:
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: docker-registry-pvc
|
||||||
|
persistence:
|
||||||
|
create: false
|
||||||
|
existingClaim: docker-registry-pvc
|
||||||
|
accessMode: ReadWriteOnce
|
||||||
|
storage: 5Gi
|
||||||
|
storageClassName: "standard"
|
||||||
2
k8s/conf/cluster-1.conf
Normal file
2
k8s/conf/cluster-1.conf
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
CLUSTER_NAME=cluster-1
|
||||||
|
PORT=9600
|
||||||
2
k8s/conf/cluster-2.conf
Normal file
2
k8s/conf/cluster-2.conf
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
CLUSTER_NAME=cluster-2
|
||||||
|
PORT=9700
|
||||||
91
k8s/datas/cluster-1/compute_resource.json
Normal file
91
k8s/datas/cluster-1/compute_resource.json
Normal file
@@ -0,0 +1,91 @@
|
|||||||
|
[{
|
||||||
|
"_id":"7b989e97-c3e7-49d2-a3a7-f959da4870b5",
|
||||||
|
"abstractinstanciatedresource":{
|
||||||
|
"abstractresource":{
|
||||||
|
"type":"compute",
|
||||||
|
"abstractobject":{
|
||||||
|
"id":"7b989e97-c3e7-49d2-a3a7-f959da4870b5",
|
||||||
|
"name":"Mundi datacenter",
|
||||||
|
"is_draft":false,
|
||||||
|
"creator_id":"c0cece97-7730-4c2a-8c20-a30944564106",
|
||||||
|
"creation_date":"2021-09-30T14:00:00.000Z",
|
||||||
|
"update_date":"2021-09-30T14:00:00.000Z",
|
||||||
|
"updater_id":"c0cece97-7730-4c2a-8c20-a30944564106",
|
||||||
|
"access_mode":1
|
||||||
|
},
|
||||||
|
"logo":"https://cloud.o-forge.io/core/deperecated-oc-catalog/raw/branch/main/scripts/local_imgs/Mundi datacenter.png",
|
||||||
|
"description":"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
|
||||||
|
"short_description":"Mundi Opencloud Instance",
|
||||||
|
"owners":[{"name":"IRT Saint Exupery"}]},
|
||||||
|
"instances":[{
|
||||||
|
"resourceinstance":{
|
||||||
|
"abstractobject":{
|
||||||
|
"id":"7b989e97-c3e7-49d2-a3a7-f959da4870b5",
|
||||||
|
"name":"Mundi datacenter Toulouse"},
|
||||||
|
"location":{"latitude":50.62925,"longitude":3.057256},
|
||||||
|
"country":250,
|
||||||
|
"partnerships":[
|
||||||
|
|
||||||
|
]},
|
||||||
|
"security_level":"public",
|
||||||
|
"annual_co2_emissions":1000,
|
||||||
|
"power_sources":["solaire","charbon"],
|
||||||
|
"cpus":{
|
||||||
|
"Intel Core i7-14700KF":{
|
||||||
|
"model":"Intel Core i7-14700KF","frequency":3.6,"cores":16,"architecture":"x86"
|
||||||
|
}},
|
||||||
|
"gpus":{
|
||||||
|
"RTX 3090 FE":{"cores":{"cuda":10496,"tensor":328},"model":"RTX 3090 FE","memory":24000}
|
||||||
|
},
|
||||||
|
"nodes":[
|
||||||
|
{"name":"default","quantity":1,"ram":{"size":16384},"cpus":{"Intel Core i7-14700KF":1},"gpus":{"RTX 3090 FE":8}},{"name":"special","quantity":2,"ram":{"size":16384},"cpus":{"Intel Core i7-14700KF":10},"gpus":{"RTX 3090 FE":10}}
|
||||||
|
]
|
||||||
|
}]
|
||||||
|
},
|
||||||
|
"architecture":"x86",
|
||||||
|
"infrastructure":0
|
||||||
|
},{
|
||||||
|
"_id":"0bb77206-371a-428e-8ae3-ff11575071e2",
|
||||||
|
"abstractinstanciatedresource":{
|
||||||
|
"abstractresource":{
|
||||||
|
"type":"compute",
|
||||||
|
"abstractobject":{
|
||||||
|
"id":"0bb77206-371a-428e-8ae3-ff11575071e2",
|
||||||
|
"name":"VM Target 2",
|
||||||
|
"is_draft":false,
|
||||||
|
"creator_id":"6a3fc74d-8c06-4dbb-ad11-d5c53562775b",
|
||||||
|
"creation_date":"2021-09-30T14:00:00.000Z",
|
||||||
|
"update_date":"2021-09-30T14:00:00.000Z",
|
||||||
|
"updater_id":"c0cece97-7730-4c2a-8c20-a30944564106",
|
||||||
|
"access_mode":1
|
||||||
|
},
|
||||||
|
"logo":"https://cloud.o-forge.io/core/deprecated-oc-catalog/raw/branch/main/scripts/local_imgs/vm_logo.png",
|
||||||
|
"description":"IP Address 172.16.0.181",
|
||||||
|
"short_description":"VM created by pierre to test admiralty",
|
||||||
|
"owners":[{"name":"IRT Saint Exupery"}]},
|
||||||
|
"instances":[
|
||||||
|
{"resourceinstance":{
|
||||||
|
"abstractobject":{"id":"0bb77206-371a-428e-8ae3-ff11575071e2","name":"VM Proxmox Pierre 2"},
|
||||||
|
"location":{"latitude":50.62925,"longitude":3.057256},"country":250,"partnerships":[
|
||||||
|
|
||||||
|
]},
|
||||||
|
"security_level":"private",
|
||||||
|
"annual_co2_emissions":1000,
|
||||||
|
"power_sources":["Larmes d'alternant"],
|
||||||
|
"cpus":{
|
||||||
|
"Intel Core Ultra 9 285K":{
|
||||||
|
"model":"Intel Core Ultra 9 285K",
|
||||||
|
"frequency":3.6,
|
||||||
|
"cores":32,
|
||||||
|
"architecture":"x86"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nodes":[{"name":"default","quantity":1,"ram":{"size":16384},"cpus":{"Intel Core Ultra 9 285K":1}}]
|
||||||
|
}
|
||||||
|
]},
|
||||||
|
"architecture":"x86","infrastructure":0},
|
||||||
|
{"_id":"7fdccb9c-7090-40a5-bacd-7435bc56c90d","abstractinstanciatedresource":{"abstractresource":{"type":"compute","abstractobject":{"id":"7fdccb9c-7090-40a5-bacd-7435bc56c90d","name":"Meteo France datacenter","is_draft":false,"creator_id":"c0cece97-7730-4c2a-8c20-a30944564106","creation_date":"2021-09-30T14:00:00.000Z","update_date":"2021-09-30T14:00:00.000Z","updater_id":"c0cece97-7730-4c2a-8c20-a30944564106","access_mode":1},"logo":"https://cloud.o-forge.io/core/deperecated-oc-catalog/raw/branch/main/scripts/local_imgs/Meteo France datacenter.png","description":"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.","short_description":"Meteo France Opencloud Instance","owners":[{"name":"Meteo France"}]},"instances":[{"resourceinstance":{"abstractobject":{"id":"7fdccb9c-7090-40a5-bacd-7435bc56c90d","name":"Meteo France datacenter Lille"},"location":{"latitude":50.62925,"longitude":3.057256},"country":250,
|
||||||
|
"partnerships":[]},"security_level":"sec num cloud","annual_co2_emissions":1000,"power_sources":["solaire","charbon"],"cpus":{"Intel Core i7-14700KF":{"model":"Intel Core i7-14700KF","frequency":3.6,"cores":16,"architecture":"x86"}},"gpus":{"RTX 3090 FE":{"cores":{"cuda":10496,"tensor":328},"model":"RTX 3090 FE","memory":24000}},"nodes":[{"name":"default","quantity":1,"ram":{"size":32786},"cpus":{"Intel Core i7-14700KF":1},"gpus":{"RTX 3090 FE":8}}]}]},"architecture":"x86","infrastructure":0},{"_id":"e22b8d96-d799-4f36-b921-982fc3c6952c","abstractinstanciatedresource":{"abstractresource":{"type":"compute","abstractobject":{"id":"e22b8d96-d799-4f36-b921-982fc3c6952c","name":"CNES datacenter","is_draft":false,"creator_id":"c0cece97-7730-4c2a-8c20-a30944564106","creation_date":"2021-09-30T14:00:00.000Z","update_date":"2021-09-30T14:00:00.000Z","updater_id":"c0cece97-7730-4c2a-8c20-a30944564106","access_mode":1},"logo":"https://cloud.o-forge.io/core/deperecated-oc-catalog/raw/branch/main/scripts/local_imgs/CNES datacenter.png","description":"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.","short_description":"Mundi Opencloud Instance","owners":[{"name":"IRT Saint Exupery"}]},"instances":[{"resourceinstance":{"abstractobject":{"id":"e22b8d96-d799-4f36-b921-982fc3c6952c","name":"CNES datacenter Toulouse"},"location":{"latitude":50.62925,"longitude":3.057256},"country":250,
|
||||||
|
"partnerships":[]},"security_level":"private","annual_co2_emissions":1000,"power_sources":["solaire","charbon"],"cpus":{"Intel Core Ultra 9 285K":{"model":"Intel Core Ultra 9 285K","frequency":3.6,"cores":32,"architecture":"x86"}},"gpus":{"RTX 3090 FE":{"cores":{"cuda":10496,"tensor":328},"model":"RTX 3090 FE","memory":24000}},"nodes":[{"name":"default","quantity":1,"ram":{"size":16384},"cpus":{"Intel Core Ultra 9 285K":1}}]}]},"architecture":"x86","infrastructure":0},{"_id":"979776c3-9ae7-4e02-9138-7b30b25f22cc","abstractinstanciatedresource":{"abstractresource":{"type":"compute","abstractobject":{"id":"979776c3-9ae7-4e02-9138-7b30b25f22cc","name":"VM Target 1","is_draft":false,"creator_id":"c0cece97-7730-4c2a-8c20-a30944564106","creation_date":"2021-09-30T14:00:00.000Z","update_date":"2021-09-30T14:00:00.000Z","updater_id":"c0cece97-7730-4c2a-8c20-a30944564106","access_mode":1},"logo":"https://cloud.o-forge.io/core/deprecated-oc-catalog/raw/branch/main/scripts/local_imgs/vm_logo.png","description":"IP Address 172.16.0.181","short_description":"VM created by pierre to test admiralty","owners":[{"name":"IRT Saint Exupery"}]},"instances":[{"resourceinstance":{"abstractobject":{"id":"979776c3-9ae7-4e02-9138-7b30b25f22cc","name":"VM Proxmox Pierre 1"},"location":{"latitude":50.62925,"longitude":3.057256},"country":250,
|
||||||
|
"partnerships":[]},"security_level":"private","annual_co2_emissions":1000,"power_sources":["Larmes d'alternant"],"cpus":{"Intel Core Ultra 9 285K":{"model":"Intel Core Ultra 9 285K","frequency":3.6,"cores":32,"architecture":"x86"}},"nodes":[{"name":"default","quantity":1,"ram":{"size":16384},"cpus":{"Intel Core Ultra 9 285K":1}}]}]},"architecture":"x86","infrastructure":0},{"_id":"4222318f-660c-47ce-9d6b-67a4691a354e","abstractinstanciatedresource":{"abstractresource":{"type":"compute","abstractobject":{"id":"4222318f-660c-47ce-9d6b-67a4691a354e","name":"VM Target 3","is_draft":false,"creator_id":"c0cece97-7730-4c2a-8c20-a30944564106","creation_date":"2021-09-30T14:00:00.000Z","update_date":"2021-09-30T14:00:00.000Z","updater_id":"c0cece97-7730-4c2a-8c20-a30944564106","access_mode":1},"logo":"https://cloud.o-forge.io/core/deprecated-oc-catalog/raw/branch/main/scripts/local_imgs/vm_logo.png","description":"IP Address 172.16.0.181","short_description":"VM created by pierre to test admiralty","owners":[{"name":"IRT Saint Exupery"}]},"instances":[{"resourceinstance":{"abstractobject":{"id":"4222318f-660c-47ce-9d6b-67a4691a354e","name":"VM Proxmox Pierre 3"},"location":{"latitude":50.62925,"longitude":3.057256},"country":250,
|
||||||
|
"partnerships":[]},"security_level":"private","annual_co2_emissions":1000,"power_sources":["Larmes d'alternant"],"cpus":{"Intel Core Ultra 9 285K":{"model":"Intel Core Ultra 9 285K","frequency":3.6,"cores":32,"architecture":"x86"}},"nodes":[{"name":"default","quantity":1,"ram":{"size":16384},"cpus":{"Intel Core Ultra 9 285K":1}}]}]},"architecture":"x86","infrastructure":0}]
|
||||||
5
k8s/datas/cluster-1/data_resource.json
Normal file
5
k8s/datas/cluster-1/data_resource.json
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
[{"_id":"292fb4c7-1ca8-4423-a969-d533b2ef3734","abstractinstanciatedresource":{"abstractresource":{"type":"data","abstractobject":{"id":"292fb4c7-1ca8-4423-a969-d533b2ef3734","name":"Mundi Sentienl 3 SRAL Images","is_draft":false,"creator_id":"c0cece97-7730-4c2a-8c20-a30944564106","creation_date":"2021-09-30T14:00:00.000Z","update_date":"2021-09-30T14:00:00.000Z","updater_id":"c0cece97-7730-4c2a-8c20-a30944564106","access_mode":1},"logo":"https://cloud.o-forge.io/core/deperecated-oc-catalog/raw/branch/main/scripts/local_imgs/Mundi Sentienl 3 SRAL Images.png","description":"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.","short_description":"Mundi Sentinels 3 SAR Altiemter image","owners":[{"name":"Mundi Web"}],"source":"http://www.google.com"},"instances":[{"resourceinstance":{"abstractobject":{"id":"7fdccb9c-7090-40a5-bacd-7435bc56c90d","name":"Mundi Sentienl 3 SRAL Images Paris"},"location":{"latitude":50.62925,"longitude":3.057256},"country":250,
|
||||||
|
"partnerships":[]}}]},"quality":"low","open_data":false,"static":true,"size":0.59,"example":"tutut"},{"_id":"d573dc63-4de0-4e29-8a4e-c15cbb3aed06","abstractinstanciatedresource":{"abstractresource":{"type":"data","abstractobject":{"id":"d573dc63-4de0-4e29-8a4e-c15cbb3aed06","name":"Red Car","is_draft":false,"creator_id":"c0cece97-7730-4c2a-8c20-a30944564106","creation_date":"2021-09-30T14:00:00.000Z","update_date":"2021-09-30T14:00:00.000Z","updater_id":"c0cece97-7730-4c2a-8c20-a30944564106","access_mode":1},"logo":"https://images.wondershare.com/repairit/article/guide-on-jpeg-repair-online-01.png","description":"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.","short_description":"A casual red car","owners":[{"name":"Red Car"}]},"instances":[{"source":"http://plates.openalpr.com/h786poj.jpg","resourceinstance":{"env":[{"attr":"source","readonly":true}],"abstractobject":{"id":"7fdccb9c-7090-40a5-bacd-7435bc56c90d","name":"Red Car"},"location":{"latitude":50.62925,"longitude":3.057256},"country":250,
|
||||||
|
"partnerships":[]}}]},"quality":"low","open_data":false,"static":true,"size":0.59,"example":"tutut"},{"_id":"811d4b6d-0170-400f-b4a5-9e1597dc7620","abstractinstanciatedresource":{"abstractresource":{"type":"data","abstractobject":{"id":"811d4b6d-0170-400f-b4a5-9e1597dc7620","name":"Meteo-France forecasts","is_draft":false,"creator_id":"c0cece97-7730-4c2a-8c20-a30944564106","creation_date":"2021-09-30T14:00:00.000Z","update_date":"2021-09-30T14:00:00.000Z","updater_id":"c0cece97-7730-4c2a-8c20-a30944564106","access_mode":1},"logo":"https://cloud.o-forge.io/core/deperecated-oc-catalog/raw/branch/main/scripts/local_imgs/Meteo-France forecasts.png","description":"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.","short_description":"Meteo France weather forecasts","owners":[{"name":"Meteo France"}],"source":"http://www.google.com"},"instances":[{"resourceinstance":{"abstractobject":{"id":"7fdccb9c-7090-40a5-bacd-7435bc56c90d","name":"Meteo-France forecasts Paris"},"location":{"latitude":50.62925,"longitude":3.057256},"country":250,
|
||||||
|
"partnerships":[]}}]},"quality":"medium","open_data":true,"static":true,"size":0.59,"example":"tutut"},{"_id":"fdfd135c-b0c1-4c34-89d5-0189b4b2bf2d","abstractinstanciatedresource":{"abstractresource":{"type":"data","abstractobject":{"id":"fdfd135c-b0c1-4c34-89d5-0189b4b2bf2d","name":"Mundi Sentienl 3 OLCI Images","is_draft":false,"creator_id":"c0cece97-7730-4c2a-8c20-a30944564106","creation_date":"2021-09-30T14:00:00.000Z","update_date":"2021-09-30T14:00:00.000Z","updater_id":"c0cece97-7730-4c2a-8c20-a30944564106","access_mode":1},"logo":"https://cloud.o-forge.io/core/deperecated-oc-catalog/raw/branch/main/scripts/local_imgs/Mundi Sentienl 3 OLCI Images.png","description":"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.","short_description":"Mundi Sentinels 3 Ocean and land color Altiemter image","owners":[{"name":"Mundi Web"}],"source":"http://www.google.com"},"instances":[{"resourceinstance":{"abstractobject":{"id":"7fdccb9c-7090-40a5-bacd-7435bc56c90d","name":"Mundi Sentienl 3 OLCI Images Paris"},"location":{"latitude":50.62925,"longitude":3.057256},"country":250,
|
||||||
|
"partnerships":[]}}]},"quality":"low","open_data":true,"static":true,"size":0.59,"example":"tutut"}]
|
||||||
33
k8s/datas/cluster-1/peer.json
Normal file
33
k8s/datas/cluster-1/peer.json
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
[{
|
||||||
|
"_id":"c0cece97-7730-4c2a-8c20-a30944564106",
|
||||||
|
"failed_execution":null,
|
||||||
|
"abstractobject":{
|
||||||
|
"update_date":{"$date":"2025-03-27T09:13:13.230Z"},"access_mode":0,
|
||||||
|
"id":"c0cece97-7730-4c2a-8c20-a30944564106",
|
||||||
|
"name":"local","is_draft":false,
|
||||||
|
"creation_date":{"$date":"2025-03-27T09:13:13.230Z"}},
|
||||||
|
"api_url":"http://192.168.1.1",
|
||||||
|
"nats_address": "nats://nats:4222",
|
||||||
|
"stream_address":"/ip4/192.168.1.1/tcp/4001/p2p/QmXkKz9kE7pY3Yw4m6x9FhJ3JY5P2QJpX9C7Yz2T4H8WvA",
|
||||||
|
"wallet_address":"my-wallet",
|
||||||
|
"public_key":"MCowBQYDK2VwAyEAZ2nLJBL8a5opfa8nFeVj0SZToW8pl4+zgcSUkeZFRO4=",
|
||||||
|
"state":1,
|
||||||
|
"peer_id": "QmXkKz9kE7pY3Yw4m6x9FhJ3JY5P2QJpX9C7Yz2T4H8WvA",
|
||||||
|
"relation": 1
|
||||||
|
}, {
|
||||||
|
"_id":"6a3fc74d-8c06-4dbb-ad11-d5c53562775b",
|
||||||
|
"failed_execution":null,
|
||||||
|
"abstractobject":{
|
||||||
|
"update_date":{"$date":"2025-03-27T09:13:13.230Z"},"access_mode":0,
|
||||||
|
"id":"6a3fc74d-8c06-4dbb-ad11-d5c53562775b",
|
||||||
|
"name":"local","is_draft":false,
|
||||||
|
"creation_date":{"$date":"2025-03-27T09:13:13.230Z"}},
|
||||||
|
"api_url":"http://192.168.1.2",
|
||||||
|
"nats_address": "nats://nats:4222",
|
||||||
|
"stream_address":"/ip4/192.168.1.1/tcp/4002/p2p/QmTzQ1NwFz9bYH7Kp8Zs4XyJQk3E6C5R9H1m2A8L7V",
|
||||||
|
"peer_id": "QmTzQ1NwFz9bYH7Kp8Zs4XyJQk3E6C5R9H1m2A8L7V",
|
||||||
|
"wallet_address":"my-wallet",
|
||||||
|
"public_key":"MCowBQYDK2VwAyEAZ2nLJBL8a5opfa8nFeVj0SZToW8pl4+zgcSUkeZFRO4=",
|
||||||
|
"state":2,
|
||||||
|
"relation": 1
|
||||||
|
}]
|
||||||
11
k8s/datas/cluster-1/processing_resource.json
Normal file
11
k8s/datas/cluster-1/processing_resource.json
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
[{"_id":"523c03fe-e2db-475c-93c6-82c5bc85ec3d","abstractinstanciatedresource":{"abstractresource":{"type":"processing","abstractobject":{"id":"523c03fe-e2db-475c-93c6-82c5bc85ec3d","name":"SAR High points","is_draft":false,"creator_id":"c0cece97-7730-4c2a-8c20-a30944564106","creation_date":"2021-09-30T14:00:00.000Z","update_date":"2021-09-30T14:00:00.000Z","updater_id":"c0cece97-7730-4c2a-8c20-a30944564106","access_mode":1},"logo":"https://cloud.o-forge.io/core/deperecated-oc-catalog/raw/branch/main/scripts/local_imgs/SAR High points.png","description":"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.","short_description":"SAR Altimeter High points extraction Software","owners":[{"name":"IRT"}]},"instances":[{"resourceinstance":{"abstractobject":{"id":"7fdccb9c-7090-40a5-bacd-7435bc56c90d","name":"SAR High points Lille"},"location":{"latitude":50.62925,"longitude":3.057256},"country":250,
|
||||||
|
"partnerships":[]}}]},"license":"GPLv2","infrastructure":0,"usage":{"storage":0.3,"scaling_model":"2"}},{"_id":"f463b2fe-0522-4382-b2ec-c82b97b9c8b0","abstractinstanciatedresource":{"abstractresource":{"type":"processing","abstractobject":{"id":"f463b2fe-0522-4382-b2ec-c82b97b9c8b0","name":"Environment builder","is_draft":false,"creator_id":"c0cece97-7730-4c2a-8c20-a30944564106","creation_date":"2021-09-30T14:00:00.000Z","update_date":"2021-09-30T14:00:00.000Z","updater_id":"c0cece97-7730-4c2a-8c20-a30944564106","access_mode":1},"logo":"https://cloud.o-forge.io/core/deperecated-oc-catalog/raw/branch/main/scripts/local_imgs/Environment builder.png","description":"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.","short_description":"build simulated environment from real environmental data and fire mitigation rules","owners":[{"name":"Gob.fr"}]},"instances":[{"resourceinstance":{"abstractobject":{"id":"7fdccb9c-7090-40a5-bacd-7435bc56c90d","name":"Environment builder Lille"},"location":{"latitude":50.62925,"longitude":3.057256},"country":250,
|
||||||
|
"partnerships":[]}}]},"license":"GPLv3","infrastructure":0,"usage":{"storage":0.3,"scaling_model":"2"}},{"_id":"f3c8346b-3536-4c99-8b11-1be9c01697de","abstractinstanciatedresource":{"abstractresource":{"type":"processing","abstractobject":{"id":"f3c8346b-3536-4c99-8b11-1be9c01697de","name":"imagemagic","is_draft":false,"creator_id":"c0cece97-7730-4c2a-8c20-a30944564106","creation_date":"2021-09-30T14:00:00.000Z","update_date":"2021-09-30T14:00:00.000Z","updater_id":"c0cece97-7730-4c2a-8c20-a30944564106","access_mode":1},"logo":"https://cloud.o-forge.io/core/deperecated-oc-catalog/raw/branch/main/scripts/local_imgs/imagemagic-logo.png","description":"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.","short_description":"ImageMagick® is a free, open-source software suite, used for editing and manipulating digital images.","owners":[{"name":"IRT"}]},"instances":[{"access":{"container":{"image":"dpokidov/imagemagick:7.1.0-62-2"}},"resourceinstance":{"abstractobject":{"id":"7fdccb9c-7090-40a5-bacd-7435bc56c90d","name":"imagemagic Lille"},"location":{"latitude":50.62925,"longitude":3.057256},"country":250,
|
||||||
|
"partnerships":[]}}]},"license":"GPLv2","infrastructure":0,"usage":{"storage":0.3,"scaling_model":"2"}},{"_id":"1b762b65-479c-45e6-a5de-fe67fd9e0f1b","abstractinstanciatedresource":{"abstractresource":{"type":"processing","abstractobject":{"id":"1b762b65-479c-45e6-a5de-fe67fd9e0f1b","name":"Long term fire risk mitigation planner","is_draft":false,"creator_id":"c0cece97-7730-4c2a-8c20-a30944564106","creation_date":"2021-09-30T14:00:00.000Z","update_date":"2021-09-30T14:00:00.000Z","updater_id":"c0cece97-7730-4c2a-8c20-a30944564106","access_mode":1},"logo":"https://cloud.o-forge.io/core/deperecated-oc-catalog/raw/branch/main/scripts/local_imgs/Long term fire risk mitigation planner.png","description":"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.","short_description":"Long term fire risk mitigation planner : provides list of actions to be performed to mitigate fire propagation","owners":[{"name":"Gob.fr"}]},"instances":[{"processinginstance":{"abstractobject":{"id":"7fdccb9c-7090-40a5-bacd-7435bc56c90d","name":"Long term fire risk mitigation planner Lille"},"location":{"latitude":50.62925,"longitude":3.057256},"country":250,
|
||||||
|
"partnerships":[]}}]},"license":"GPLv2","infrastructure":0,"usage":{"storage":0.3,"scaling_model":"2"}},{"_id":"e518d7a4-426a-4900-94e5-300767b1bb31","abstractinstanciatedresource":{"abstractresource":{"type":"processing","abstractobject":{"id":"e518d7a4-426a-4900-94e5-300767b1bb31","name":"Mosquito server","is_draft":false,"creator_id":"c0cece97-7730-4c2a-8c20-a30944564106","creation_date":"2021-09-30T14:00:00.000Z","update_date":"2021-09-30T14:00:00.000Z","updater_id":"c0cece97-7730-4c2a-8c20-a30944564106","access_mode":1},"logo":"https://cloud.o-forge.io/core/deperecated-oc-catalog/raw/branch/main/scripts/local_imgs/mosquitto-logo.png","description":"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.","short_description":"open source message broker that implements the MQTT protocol versions 5.0, 3.1.1 and 3.1.","owners":[{"name":"IRT"}]},"instances":[{"access":{"container":{"image":"eclipse-mosquitto:2.0.15"}},"resourceinstance":{"abstractobject":{"id":"7fdccb9c-7090-40a5-bacd-7435bc56c90d","name":"Mosquito server Lille"},"location":{"latitude":50.62925,"longitude":3.057256},"country":250,
|
||||||
|
"partnerships":[]}}]},"license":"GPLv2","infrastructure":0,"usage":{"storage":0.3,"scaling_model":"2"}},{"_id":"0d565c87-50ae-4a73-843d-f8b2d4047772","abstractinstanciatedresource":{"abstractresource":{"type":"processing","abstractobject":{"id":"0d565c87-50ae-4a73-843d-f8b2d4047772","name":"CURL","is_draft":false,"creator_id":"c0cece97-7730-4c2a-8c20-a30944564106","creation_date":"2021-09-30T14:00:00.000Z","update_date":"2021-09-30T14:00:00.000Z","updater_id":"c0cece97-7730-4c2a-8c20-a30944564106","access_mode":1},"logo":"https://cloud.o-forge.io/core/deperecated-oc-catalog/raw/branch/main/scripts/local_imgs/curl-logo.png","description":"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.","short_description":"Transfer or retrieve information from or to a server","owners":[{"name":"IRT"}]},"instances":[{"access":{"container":{"image":"curlimages/curl:7.88.1"}},"resourceinstance":{"abstractobject":{"id":"7fdccb9c-7090-40a5-bacd-7435bc56c90d","name":"CURL Lille"},"location":{"latitude":50.62925,"longitude":3.057256},"country":250,
|
||||||
|
"partnerships":[]}}]},"license":"GPLv2","infrastructure":0,"usage":{"storage":0.3,"scaling_model":"2"}},{"_id":"7cf24357-b272-4a4b-b2d8-479887e1c937","abstractinstanciatedresource":{"abstractresource":{"type":"processing","abstractobject":{"id":"7cf24357-b272-4a4b-b2d8-479887e1c937","name":"Fire propagation simulator","is_draft":false,"creator_id":"c0cece97-7730-4c2a-8c20-a30944564106","creation_date":"2021-09-30T14:00:00.000Z","update_date":"2021-09-30T14:00:00.000Z","updater_id":"c0cece97-7730-4c2a-8c20-a30944564106","access_mode":1},"logo":"https://cloud.o-forge.io/core/deperecated-oc-catalog/raw/branch/main/scripts/local_imgs/Fire propagation simulator.png","description":"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.","short_description":"Fire propagation simulator","owners":[{"name":"Gob.fr"}]},"instances":[{"resourceinstance":{"abstractobject":{"id":"7fdccb9c-7090-40a5-bacd-7435bc56c90d","name":"Fire propagation simulator Lille"},"location":{"latitude":50.62925,"longitude":3.057256},"country":250,
|
||||||
|
"partnerships":[]}}]},"license":"GPLv3","infrastructure":0,"usage":{"storage":3,"scaling_model":"2"}},{"_id":"3041990c-5c5d-40c4-8329-c1df1b812dc3","abstractinstanciatedresource":{"abstractresource":{"type":"processing","abstractobject":{"id":"3041990c-5c5d-40c4-8329-c1df1b812dc3","name":"alpr","is_draft":false,"creator_id":"c0cece97-7730-4c2a-8c20-a30944564106","creation_date":"2021-09-30T14:00:00.000Z","update_date":"2021-09-30T14:00:00.000Z","updater_id":"c0cece97-7730-4c2a-8c20-a30944564106","access_mode":1},"logo":"https://cloud.o-forge.io/core/deperecated-oc-catalog/raw/branch/main/scripts/local_imgs/alpr-logo.png","description":"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.","short_description":"Open source Automatic License Plate Recognition library.","owners":[{"name":"IRT"}]},"instances":[{"access":{"container":{"image":"openalpr/openalpr"}},"resourceinstance":{"abstractobject":{"id":"7fdccb9c-7090-40a5-bacd-7435bc56c90d","name":"alpr Lille"},"location":{"latitude":50.62925,"longitude":3.057256},"country":250,
|
||||||
|
"partnerships":[]}}]},"license":"GPLv3","infrastructure":0,"usage":{"storage":0.3,"scaling_model":"2"}},{"_id":"2ce0323f-a85d-4b8b-a783-5280f48d634a","abstractinstanciatedresource":{"abstractresource":{"type":"processing","abstractobject":{"id":"2ce0323f-a85d-4b8b-a783-5280f48d634a","name":"alpine","is_draft":false,"creator_id":"c0cece97-7730-4c2a-8c20-a30944564106","creation_date":"2021-09-30T14:00:00.000Z","update_date":"2021-09-30T14:00:00.000Z","updater_id":"c0cece97-7730-4c2a-8c20-a30944564106","access_mode":1},"logo":"https://cloud.o-forge.io/core/deperecated-oc-catalog/raw/branch/main/scripts/local_imgs/alpine-logo.png","description":"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.","short_description":"A minimal Docker image","owners":[{"name":"IRT"}]},"instances":[{"access":{"container":{"image":"alpine:3.7"}},"resourceinstance":{"abstractobject":{"id":"7fdccb9c-7090-40a5-bacd-7435bc56c90d","name":"alpine Lille"},"location":{"latitude":50.62925,"longitude":3.057256},"country":250,
|
||||||
|
"partnerships":[]}}]},"license":"GPLv2","infrastructure":0,"usage":{"storage":0.3,"scaling_model":"2"}},{"_id":"8a78cecc-8222-40ed-9303-04e24d136f49","abstractinstanciatedresource":{"abstractresource":{"type":"processing","abstractobject":{"id":"8a78cecc-8222-40ed-9303-04e24d136f49","name":"Flammable vegetation slicer","is_draft":false,"creator_id":"c0cece97-7730-4c2a-8c20-a30944564106","creation_date":"2021-09-30T14:00:00.000Z","update_date":"2021-09-30T14:00:00.000Z","updater_id":"c0cece97-7730-4c2a-8c20-a30944564106","access_mode":1},"logo":"https://cloud.o-forge.io/core/deperecated-oc-catalog/raw/branch/main/scripts/local_imgs/Flammable vegetation slicer.png","description":"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.","short_description":"Analyze land cover and define optimum vegetation slices to prevent fire propagation","owners":[{"name":"Gob.fr"}]},"instances":[{"resourceinstance":{"abstractobject":{"id":"7fdccb9c-7090-40a5-bacd-7435bc56c90d","name":"Flammable vegetation slicer Lille"},"location":{"latitude":50.62925,"longitude":3.057256},"country":250,
|
||||||
|
"partnerships":[]}}]},"license":"Copyright","infrastructure":0,"usage":{"storage":0.3,"scaling_model":"2"}}]
|
||||||
3
k8s/datas/cluster-1/storage_resource.json
Normal file
3
k8s/datas/cluster-1/storage_resource.json
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
[{"_id":"04bc70b5-8d7b-44e6-9015-fadfa0fb102d","abstractinstanciatedresource":{"abstractresource":{"type":"storage","abstractobject":{"id":"04bc70b5-8d7b-44e6-9015-fadfa0fb102d","name":"IRT risk database","is_draft":false,"creator_id":"c0cece97-7730-4c2a-8c20-a30944564106","creation_date":"2021-09-30T14:00:00.000Z","update_date":"2021-09-30T14:00:00.000Z","updater_id":"c0cece97-7730-4c2a-8c20-a30944564106","access_mode":1},"logo":"https://cloud.o-forge.io/core/deperecated-oc-catalog/raw/branch/main/scripts/local_imgs/IRT risk database.png","description":"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.","short_description":"S3 compliant IRT file storage","owners":[{"name":"IRT"}]},"instances":[{"env":[{"attr":"source","readonly":true}],"resourceinstance":{"abstractobject":{"id":"7fdccb9c-7090-40a5-bacd-7435bc56c90d","name":"IRT local file storage Marseille"},"location":{"latitude":50.62925,"longitude":3.057256},"country":250,
|
||||||
|
"partnerships":[]},"source":"/mnt/vol","local":false,"security_level":"public","size":50,"size_type":3,"redundancy":"RAID5","throughput":"r:200,w:150"}]},"storage_type":5,"acronym":"DC_myDC"},{"_id":"e726020a-b68e-4abc-ab36-c3640ea3f557","abstractinstanciatedresource":{"abstractresource":{"type":"storage","abstractobject":{"id":"e726020a-b68e-4abc-ab36-c3640ea3f557","name":"IRT local file storage","is_draft":false,"creator_id":"c0cece97-7730-4c2a-8c20-a30944564106","creation_date":"2021-09-30T14:00:00.000Z","update_date":"2021-09-30T14:00:00.000Z","updater_id":"c0cece97-7730-4c2a-8c20-a30944564106","access_mode":1},"logo":"https://cloud.o-forge.io/core/deperecated-oc-catalog/raw/branch/main/scripts/local_imgs/IRT local file storage.png","description":"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.","short_description":"S3 compliant IRT file storage","owners":[{"name":"IRT"}]},"instances":[{"resourceinstance":{"env":[{"attr":"source","readonly":true}],"abstractobject":{"id":"7fdccb9c-7090-40a5-bacd-7435bc56c90d","name":"IRT local file storage Marseille"},"location":{"latitude":50.62925,"longitude":3.057256},"country":250,
|
||||||
|
"partnerships":[]},"source":"/mnt/vol","local":true,"security_level":"public","size":500,"size_type":0,"encryption":true,"redundancy":"RAID5S","throughput":"r:300,w:350"}]},"storage_type":5,"acronym":"DC_myDC"}]
|
||||||
6
k8s/datas/cluster-1/workflow.json
Normal file
6
k8s/datas/cluster-1/workflow.json
Normal file
File diff suppressed because one or more lines are too long
87
k8s/datas/cluster-2/compute_resource.json
Normal file
87
k8s/datas/cluster-2/compute_resource.json
Normal file
File diff suppressed because one or more lines are too long
5
k8s/datas/cluster-2/data_resource.json
Normal file
5
k8s/datas/cluster-2/data_resource.json
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
[{"_id":"292fb4c7-1ca8-4423-a969-d533b2ef3734","abstractinstanciatedresource":{"abstractresource":{"type":"data","abstractobject":{"id":"292fb4c7-1ca8-4423-a969-d533b2ef3734","name":"Mundi Sentienl 3 SRAL Images","is_draft":false,"creator_id":"c0cece97-7730-4c2a-8c20-a30944564106","creation_date":"2021-09-30T14:00:00.000Z","update_date":"2021-09-30T14:00:00.000Z","updater_id":"c0cece97-7730-4c2a-8c20-a30944564106","access_mode":1},"logo":"https://cloud.o-forge.io/core/deperecated-oc-catalog/raw/branch/main/scripts/local_imgs/Mundi Sentienl 3 SRAL Images.png","description":"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.","short_description":"Mundi Sentinels 3 SAR Altiemter image","owners":[{"name":"Mundi Web"}],"source":"http://www.google.com"},"instances":[{"resourceinstance":{"abstractobject":{"id":"7fdccb9c-7090-40a5-bacd-7435bc56c90d","name":"Mundi Sentienl 3 SRAL Images Paris"},"location":{"latitude":50.62925,"longitude":3.057256},"country":250,
|
||||||
|
"partnerships":[]}}]},"quality":"low","open_data":false,"static":true,"size":0.59,"example":"tutut"},{"_id":"d573dc63-4de0-4e29-8a4e-c15cbb3aed06","abstractinstanciatedresource":{"abstractresource":{"type":"data","abstractobject":{"id":"d573dc63-4de0-4e29-8a4e-c15cbb3aed06","name":"Red Car","is_draft":false,"creator_id":"c0cece97-7730-4c2a-8c20-a30944564106","creation_date":"2021-09-30T14:00:00.000Z","update_date":"2021-09-30T14:00:00.000Z","updater_id":"c0cece97-7730-4c2a-8c20-a30944564106","access_mode":1},"logo":"https://images.wondershare.com/repairit/article/guide-on-jpeg-repair-online-01.png","description":"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.","short_description":"A casual red car","owners":[{"name":"Red Car"}]},"instances":[{"source":"http://plates.openalpr.com/h786poj.jpg","resourceinstance":{"env":[{"attr":"source","readonly":true}],"abstractobject":{"id":"7fdccb9c-7090-40a5-bacd-7435bc56c90d","name":"Red Car"},"location":{"latitude":50.62925,"longitude":3.057256},"country":250,
|
||||||
|
"partnerships":[]}}]},"quality":"low","open_data":false,"static":true,"size":0.59,"example":"tutut"},{"_id":"811d4b6d-0170-400f-b4a5-9e1597dc7620","abstractinstanciatedresource":{"abstractresource":{"type":"data","abstractobject":{"id":"811d4b6d-0170-400f-b4a5-9e1597dc7620","name":"Meteo-France forecasts","is_draft":false,"creator_id":"c0cece97-7730-4c2a-8c20-a30944564106","creation_date":"2021-09-30T14:00:00.000Z","update_date":"2021-09-30T14:00:00.000Z","updater_id":"c0cece97-7730-4c2a-8c20-a30944564106","access_mode":1},"logo":"https://cloud.o-forge.io/core/deperecated-oc-catalog/raw/branch/main/scripts/local_imgs/Meteo-France forecasts.png","description":"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.","short_description":"Meteo France weather forecasts","owners":[{"name":"Meteo France"}],"source":"http://www.google.com"},"instances":[{"resourceinstance":{"abstractobject":{"id":"7fdccb9c-7090-40a5-bacd-7435bc56c90d","name":"Meteo-France forecasts Paris"},"location":{"latitude":50.62925,"longitude":3.057256},"country":250,
|
||||||
|
"partnerships":[]}}]},"quality":"medium","open_data":true,"static":true,"size":0.59,"example":"tutut"},{"_id":"fdfd135c-b0c1-4c34-89d5-0189b4b2bf2d","abstractinstanciatedresource":{"abstractresource":{"type":"data","abstractobject":{"id":"fdfd135c-b0c1-4c34-89d5-0189b4b2bf2d","name":"Mundi Sentienl 3 OLCI Images","is_draft":false,"creator_id":"c0cece97-7730-4c2a-8c20-a30944564106","creation_date":"2021-09-30T14:00:00.000Z","update_date":"2021-09-30T14:00:00.000Z","updater_id":"c0cece97-7730-4c2a-8c20-a30944564106","access_mode":1},"logo":"https://cloud.o-forge.io/core/deperecated-oc-catalog/raw/branch/main/scripts/local_imgs/Mundi Sentienl 3 OLCI Images.png","description":"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.","short_description":"Mundi Sentinels 3 Ocean and land color Altiemter image","owners":[{"name":"Mundi Web"}],"source":"http://www.google.com"},"instances":[{"resourceinstance":{"abstractobject":{"id":"7fdccb9c-7090-40a5-bacd-7435bc56c90d","name":"Mundi Sentienl 3 OLCI Images Paris"},"location":{"latitude":50.62925,"longitude":3.057256},"country":250,
|
||||||
|
"partnerships":[]}}]},"quality":"low","open_data":true,"static":true,"size":0.59,"example":"tutut"}]
|
||||||
27
k8s/datas/cluster-2/peer.json
Normal file
27
k8s/datas/cluster-2/peer.json
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
[{
|
||||||
|
"_id":"c0cece97-7730-4c2a-8c20-a30944564106",
|
||||||
|
"failed_execution":null,
|
||||||
|
"abstractobject":{
|
||||||
|
"update_date":{"$date":"2025-03-27T09:13:13.230Z"},"access_mode":0,
|
||||||
|
"id":"c0cece97-7730-4c2a-8c20-a30944564106",
|
||||||
|
"name":"local","is_draft":false,
|
||||||
|
"creation_date":{"$date":"2025-03-27T09:13:13.230Z"}},
|
||||||
|
"url":"http://192.168.1.1",
|
||||||
|
"wallet_address":"my-wallet",
|
||||||
|
"public_key":"-----BEGIN RSA PUBLIC KEY-----\nMIICCgKCAgEAw2pdG6wMtuLcP0+k1LFvIb0DQo/oHW2uNJaEJK74plXqp4ztz2dR\nb+RQHFLeLuqk4i/zc3b4K3fKPXSlwnVPJCwzPrnyT8jYGOZVlWlETiV9xeJhu6s/\nBh6g1PWz75XjjwV50iv/CEiLNBT23f/3J44wrQzygqNQCiQSALdxWLAEl4l5kHSa\n9oMyV70/Uql94/ayMARZsHgp9ZvqQKbkZPw6yzVMfCBxQozlNlo315OHevudhnhp\nDRjN5I7zWmqYt6rbXJJC7Y3Izdvzn7QI88RqjSRST5I/7Kz3ndCqrOnI+OQUE5NT\nREyQebphvQfTDTKlRPXkdyktdK2DH28Zj6ZF3yjQvN35Q4zhOzlq77dO5IhhopI7\nct8dZH1T1nYkvdyCA/EVMtQsASmBOitH0Y0ACoXQK5Kb6nm/TcM/9ZSJUNiEMuy5\ngBZ3YKE9oa4cpTpPXwcA+S/cU7HPNnQAsvD3iJi8GTW9uJs84pn4/WhpQqmXd4rv\nhKWECCN3fHy01fUs/U0PaSj2jDY/kQVeXoikNMzPUjdZd9m816TIBh3v3aVXCH/0\niTHHAxctvDgMRb2fpvRJ/wwnYjFG9RpamVFDMvC9NffuYzWAA9IRIY4cqgerfHrV\nZ2HHiPTDDvDAIsvImXZc/h7mXN6m3RCQ4Qywy993wd9gUdgg/qnynHcCAwEAAQ==\n-----END RSA PUBLIC KEY-----\n",
|
||||||
|
"state":2,
|
||||||
|
"relation": 1
|
||||||
|
}, {
|
||||||
|
"_id":"6a3fc74d-8c06-4dbb-ad11-d5c53562775b",
|
||||||
|
"failed_execution":null,
|
||||||
|
"abstractobject":{
|
||||||
|
"update_date":{"$date":"2025-03-27T09:13:13.230Z"},"access_mode":0,
|
||||||
|
"id":"6a3fc74d-8c06-4dbb-ad11-d5c53562775b",
|
||||||
|
"name":"local","is_draft":false,
|
||||||
|
"creation_date":{"$date":"2025-03-27T09:13:13.230Z"}},
|
||||||
|
"url":"http://192.168.1.2",
|
||||||
|
"wallet_address":"my-wallet",
|
||||||
|
"public_key":"-----BEGIN RSA PUBLIC KEY-----\nMIICCgKCAgEAw2pdG6wMtuLcP0+k1LFvIb0DQo/oHW2uNJaEJK74plXqp4ztz2dR\nb+RQHFLeLuqk4i/zc3b4K3fKPXSlwnVPJCwzPrnyT8jYGOZVlWlETiV9xeJhu6s/\nBh6g1PWz75XjjwV50iv/CEiLNBT23f/3J44wrQzygqNQCiQSALdxWLAEl4l5kHSa\n9oMyV70/Uql94/ayMARZsHgp9ZvqQKbkZPw6yzVMfCBxQozlNlo315OHevudhnhp\nDRjN5I7zWmqYt6rbXJJC7Y3Izdvzn7QI88RqjSRST5I/7Kz3ndCqrOnI+OQUE5NT\nREyQebphvQfTDTKlRPXkdyktdK2DH28Zj6ZF3yjQvN35Q4zhOzlq77dO5IhhopI7\nct8dZH1T1nYkvdyCA/EVMtQsASmBOitH0Y0ACoXQK5Kb6nm/TcM/9ZSJUNiEMuy5\ngBZ3YKE9oa4cpTpPXwcA+S/cU7HPNnQAsvD3iJi8GTW9uJs84pn4/WhpQqmXd4rv\nhKWECCN3fHy01fUs/U0PaSj2jDY/kQVeXoikNMzPUjdZd9m816TIBh3v3aVXCH/0\niTHHAxctvDgMRb2fpvRJ/wwnYjFG9RpamVFDMvC9NffuYzWAA9IRIY4cqgerfHrV\nZ2HHiPTDDvDAIsvImXZc/h7mXN6m3RCQ4Qywy993wd9gUdgg/qnynHcCAwEAAQ==\n-----END RSA PUBLIC KEY-----\n",
|
||||||
|
"state":1,
|
||||||
|
"relation": 1
|
||||||
|
}]
|
||||||
11
k8s/datas/cluster-2/processing_resource.json
Normal file
11
k8s/datas/cluster-2/processing_resource.json
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
[{"_id":"523c03fe-e2db-475c-93c6-82c5bc85ec3d","abstractinstanciatedresource":{"abstractresource":{"type":"processing","abstractobject":{"id":"523c03fe-e2db-475c-93c6-82c5bc85ec3d","name":"SAR High points","is_draft":false,"creator_id":"c0cece97-7730-4c2a-8c20-a30944564106","creation_date":"2021-09-30T14:00:00.000Z","update_date":"2021-09-30T14:00:00.000Z","updater_id":"c0cece97-7730-4c2a-8c20-a30944564106","access_mode":1},"logo":"https://cloud.o-forge.io/core/deperecated-oc-catalog/raw/branch/main/scripts/local_imgs/SAR High points.png","description":"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.","short_description":"SAR Altimeter High points extraction Software","owners":[{"name":"IRT"}]},"instances":[{"resourceinstance":{"abstractobject":{"id":"7fdccb9c-7090-40a5-bacd-7435bc56c90d","name":"SAR High points Lille"},"location":{"latitude":50.62925,"longitude":3.057256},"country":250,
|
||||||
|
"partnerships":[]}}]},"license":"GPLv2","infrastructure":0,"usage":{"storage":0.3,"scaling_model":"2"}},{"_id":"f463b2fe-0522-4382-b2ec-c82b97b9c8b0","abstractinstanciatedresource":{"abstractresource":{"type":"processing","abstractobject":{"id":"f463b2fe-0522-4382-b2ec-c82b97b9c8b0","name":"Environment builder","is_draft":false,"creator_id":"c0cece97-7730-4c2a-8c20-a30944564106","creation_date":"2021-09-30T14:00:00.000Z","update_date":"2021-09-30T14:00:00.000Z","updater_id":"c0cece97-7730-4c2a-8c20-a30944564106","access_mode":1},"logo":"https://cloud.o-forge.io/core/deperecated-oc-catalog/raw/branch/main/scripts/local_imgs/Environment builder.png","description":"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.","short_description":"build simulated environment from real environmental data and fire mitigation rules","owners":[{"name":"Gob.fr"}]},"instances":[{"resourceinstance":{"abstractobject":{"id":"7fdccb9c-7090-40a5-bacd-7435bc56c90d","name":"Environment builder Lille"},"location":{"latitude":50.62925,"longitude":3.057256},"country":250,
|
||||||
|
"partnerships":[]}}]},"license":"GPLv3","infrastructure":0,"usage":{"storage":0.3,"scaling_model":"2"}},{"_id":"f3c8346b-3536-4c99-8b11-1be9c01697de","abstractinstanciatedresource":{"abstractresource":{"type":"processing","abstractobject":{"id":"f3c8346b-3536-4c99-8b11-1be9c01697de","name":"imagemagic","is_draft":false,"creator_id":"c0cece97-7730-4c2a-8c20-a30944564106","creation_date":"2021-09-30T14:00:00.000Z","update_date":"2021-09-30T14:00:00.000Z","updater_id":"c0cece97-7730-4c2a-8c20-a30944564106","access_mode":1},"logo":"https://cloud.o-forge.io/core/deperecated-oc-catalog/raw/branch/main/scripts/local_imgs/imagemagic-logo.png","description":"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.","short_description":"ImageMagick® is a free, open-source software suite, used for editing and manipulating digital images.","owners":[{"name":"IRT"}]},"instances":[{"access":{"container":{"image":"dpokidov/imagemagick:7.1.0-62-2"}},"resourceinstance":{"abstractobject":{"id":"7fdccb9c-7090-40a5-bacd-7435bc56c90d","name":"imagemagic Lille"},"location":{"latitude":50.62925,"longitude":3.057256},"country":250,
|
||||||
|
"partnerships":[]}}]},"license":"GPLv2","infrastructure":0,"usage":{"storage":0.3,"scaling_model":"2"}},{"_id":"1b762b65-479c-45e6-a5de-fe67fd9e0f1b","abstractinstanciatedresource":{"abstractresource":{"type":"processing","abstractobject":{"id":"1b762b65-479c-45e6-a5de-fe67fd9e0f1b","name":"Long term fire risk mitigation planner","is_draft":false,"creator_id":"c0cece97-7730-4c2a-8c20-a30944564106","creation_date":"2021-09-30T14:00:00.000Z","update_date":"2021-09-30T14:00:00.000Z","updater_id":"c0cece97-7730-4c2a-8c20-a30944564106","access_mode":1},"logo":"https://cloud.o-forge.io/core/deperecated-oc-catalog/raw/branch/main/scripts/local_imgs/Long term fire risk mitigation planner.png","description":"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.","short_description":"Long term fire risk mitigation planner : provides list of actions to be performed to mitigate fire propagation","owners":[{"name":"Gob.fr"}]},"instances":[{"processinginstance":{"abstractobject":{"id":"7fdccb9c-7090-40a5-bacd-7435bc56c90d","name":"Long term fire risk mitigation planner Lille"},"location":{"latitude":50.62925,"longitude":3.057256},"country":250,
|
||||||
|
"partnerships":[]}}]},"license":"GPLv2","infrastructure":0,"usage":{"storage":0.3,"scaling_model":"2"}},{"_id":"e518d7a4-426a-4900-94e5-300767b1bb31","abstractinstanciatedresource":{"abstractresource":{"type":"processing","abstractobject":{"id":"e518d7a4-426a-4900-94e5-300767b1bb31","name":"Mosquito server","is_draft":false,"creator_id":"c0cece97-7730-4c2a-8c20-a30944564106","creation_date":"2021-09-30T14:00:00.000Z","update_date":"2021-09-30T14:00:00.000Z","updater_id":"c0cece97-7730-4c2a-8c20-a30944564106","access_mode":1},"logo":"https://cloud.o-forge.io/core/deperecated-oc-catalog/raw/branch/main/scripts/local_imgs/mosquitto-logo.png","description":"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.","short_description":"open source message broker that implements the MQTT protocol versions 5.0, 3.1.1 and 3.1.","owners":[{"name":"IRT"}]},"instances":[{"access":{"container":{"image":"eclipse-mosquitto:2.0.15"}},"resourceinstance":{"abstractobject":{"id":"7fdccb9c-7090-40a5-bacd-7435bc56c90d","name":"Mosquito server Lille"},"location":{"latitude":50.62925,"longitude":3.057256},"country":250,
|
||||||
|
"partnerships":[]}}]},"license":"GPLv2","infrastructure":0,"usage":{"storage":0.3,"scaling_model":"2"}},{"_id":"0d565c87-50ae-4a73-843d-f8b2d4047772","abstractinstanciatedresource":{"abstractresource":{"type":"processing","abstractobject":{"id":"0d565c87-50ae-4a73-843d-f8b2d4047772","name":"CURL","is_draft":false,"creator_id":"c0cece97-7730-4c2a-8c20-a30944564106","creation_date":"2021-09-30T14:00:00.000Z","update_date":"2021-09-30T14:00:00.000Z","updater_id":"c0cece97-7730-4c2a-8c20-a30944564106","access_mode":1},"logo":"https://cloud.o-forge.io/core/deperecated-oc-catalog/raw/branch/main/scripts/local_imgs/curl-logo.png","description":"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.","short_description":"Transfer or retrieve information from or to a server","owners":[{"name":"IRT"}]},"instances":[{"access":{"container":{"image":"curlimages/curl:7.88.1"}},"resourceinstance":{"abstractobject":{"id":"7fdccb9c-7090-40a5-bacd-7435bc56c90d","name":"CURL Lille"},"location":{"latitude":50.62925,"longitude":3.057256},"country":250,
|
||||||
|
"partnerships":[]}}]},"license":"GPLv2","infrastructure":0,"usage":{"storage":0.3,"scaling_model":"2"}},{"_id":"7cf24357-b272-4a4b-b2d8-479887e1c937","abstractinstanciatedresource":{"abstractresource":{"type":"processing","abstractobject":{"id":"7cf24357-b272-4a4b-b2d8-479887e1c937","name":"Fire propagation simulator","is_draft":false,"creator_id":"c0cece97-7730-4c2a-8c20-a30944564106","creation_date":"2021-09-30T14:00:00.000Z","update_date":"2021-09-30T14:00:00.000Z","updater_id":"c0cece97-7730-4c2a-8c20-a30944564106","access_mode":1},"logo":"https://cloud.o-forge.io/core/deperecated-oc-catalog/raw/branch/main/scripts/local_imgs/Fire propagation simulator.png","description":"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.","short_description":"Fire propagation simulator","owners":[{"name":"Gob.fr"}]},"instances":[{"resourceinstance":{"abstractobject":{"id":"7fdccb9c-7090-40a5-bacd-7435bc56c90d","name":"Fire propagation simulator Lille"},"location":{"latitude":50.62925,"longitude":3.057256},"country":250,
|
||||||
|
"partnerships":[]}}]},"license":"GPLv3","infrastructure":0,"usage":{"storage":3,"scaling_model":"2"}},{"_id":"3041990c-5c5d-40c4-8329-c1df1b812dc3","abstractinstanciatedresource":{"abstractresource":{"type":"processing","abstractobject":{"id":"3041990c-5c5d-40c4-8329-c1df1b812dc3","name":"alpr","is_draft":false,"creator_id":"c0cece97-7730-4c2a-8c20-a30944564106","creation_date":"2021-09-30T14:00:00.000Z","update_date":"2021-09-30T14:00:00.000Z","updater_id":"c0cece97-7730-4c2a-8c20-a30944564106","access_mode":1},"logo":"https://cloud.o-forge.io/core/deperecated-oc-catalog/raw/branch/main/scripts/local_imgs/alpr-logo.png","description":"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.","short_description":"Open source Automatic License Plate Recognition library.","owners":[{"name":"IRT"}]},"instances":[{"access":{"container":{"image":"openalpr/openalpr"}},"resourceinstance":{"abstractobject":{"id":"7fdccb9c-7090-40a5-bacd-7435bc56c90d","name":"alpr Lille"},"location":{"latitude":50.62925,"longitude":3.057256},"country":250,
|
||||||
|
"partnerships":[]}}]},"license":"GPLv3","infrastructure":0,"usage":{"storage":0.3,"scaling_model":"2"}},{"_id":"2ce0323f-a85d-4b8b-a783-5280f48d634a","abstractinstanciatedresource":{"abstractresource":{"type":"processing","abstractobject":{"id":"2ce0323f-a85d-4b8b-a783-5280f48d634a","name":"alpine","is_draft":false,"creator_id":"c0cece97-7730-4c2a-8c20-a30944564106","creation_date":"2021-09-30T14:00:00.000Z","update_date":"2021-09-30T14:00:00.000Z","updater_id":"c0cece97-7730-4c2a-8c20-a30944564106","access_mode":1},"logo":"https://cloud.o-forge.io/core/deperecated-oc-catalog/raw/branch/main/scripts/local_imgs/alpine-logo.png","description":"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.","short_description":"A minimal Docker image","owners":[{"name":"IRT"}]},"instances":[{"access":{"container":{"image":"alpine:3.7"}},"resourceinstance":{"abstractobject":{"id":"7fdccb9c-7090-40a5-bacd-7435bc56c90d","name":"alpine Lille"},"location":{"latitude":50.62925,"longitude":3.057256},"country":250,
|
||||||
|
"partnerships":[]}}]},"license":"GPLv2","infrastructure":0,"usage":{"storage":0.3,"scaling_model":"2"}},{"_id":"8a78cecc-8222-40ed-9303-04e24d136f49","abstractinstanciatedresource":{"abstractresource":{"type":"processing","abstractobject":{"id":"8a78cecc-8222-40ed-9303-04e24d136f49","name":"Flammable vegetation slicer","is_draft":false,"creator_id":"c0cece97-7730-4c2a-8c20-a30944564106","creation_date":"2021-09-30T14:00:00.000Z","update_date":"2021-09-30T14:00:00.000Z","updater_id":"c0cece97-7730-4c2a-8c20-a30944564106","access_mode":1},"logo":"https://cloud.o-forge.io/core/deperecated-oc-catalog/raw/branch/main/scripts/local_imgs/Flammable vegetation slicer.png","description":"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.","short_description":"Analyze land cover and define optimum vegetation slices to prevent fire propagation","owners":[{"name":"Gob.fr"}]},"instances":[{"resourceinstance":{"abstractobject":{"id":"7fdccb9c-7090-40a5-bacd-7435bc56c90d","name":"Flammable vegetation slicer Lille"},"location":{"latitude":50.62925,"longitude":3.057256},"country":250,
|
||||||
|
"partnerships":[]}}]},"license":"Copyright","infrastructure":0,"usage":{"storage":0.3,"scaling_model":"2"}}]
|
||||||
6
k8s/datas/cluster-2/workflow.json
Normal file
6
k8s/datas/cluster-2/workflow.json
Normal file
File diff suppressed because one or more lines are too long
30
k8s/start-demo.sh
Executable file
30
k8s/start-demo.sh
Executable file
@@ -0,0 +1,30 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
mode=${2:-all}
|
||||||
|
branch=${3:-main}
|
||||||
|
path=${4:-.}
|
||||||
|
|
||||||
|
start=1
|
||||||
|
end=${1:-1}
|
||||||
|
|
||||||
|
curl -L -o oc-k8s https://cloud.o-forge.io/core/oc-k8s/raw/branch/main/cmd/oc-k8s
|
||||||
|
sudo cp ./oc-k8s /usr/local/bin
|
||||||
|
|
||||||
|
|
||||||
|
sudo sysctl fs.inotify.max_user_watches=524288
|
||||||
|
sudo sysctl fs.inotify.max_user_instances=512
|
||||||
|
|
||||||
|
echo "Install oc-k8s"
|
||||||
|
|
||||||
|
oc-k8s install
|
||||||
|
|
||||||
|
cp ~/.kube/config ~/.kube/config_past
|
||||||
|
|
||||||
|
for ((i=start; i<=end; i++)); do
|
||||||
|
echo "Run cluster-$i"
|
||||||
|
sudo cp /etc/rancher/k3s/k3s.yaml ~/.kube/config
|
||||||
|
|
||||||
|
./start.sh $mode $branch "cluster-$i" $path
|
||||||
|
|
||||||
|
sudo cp ~/.kube/config ~/.kube/configCluster$i
|
||||||
|
sudo chown $(id -u):$(id -g) ~/.kube/configCluster$i
|
||||||
|
done
|
||||||
22
k8s/start.sh
Executable file
22
k8s/start.sh
Executable file
@@ -0,0 +1,22 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
mode=${1:-all}
|
||||||
|
branch=${2:-main}
|
||||||
|
clustername=${3:-opencloud}
|
||||||
|
path=${4:-.}
|
||||||
|
|
||||||
|
echo "Create values for $clustername"
|
||||||
|
|
||||||
|
if [ -f "./conf/$clustername.conf" ]; then
|
||||||
|
oc-k8s create values -n $clustername -r $clustername -f $path -c "./conf/$clustername.conf"
|
||||||
|
else
|
||||||
|
oc-k8s create values -n $clustername -r $clustername -f $path
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Start $clustername"
|
||||||
|
|
||||||
|
oc-k8s start -f $path -r $clustername -n $clustername -t $mode -b $branch
|
||||||
|
|
||||||
|
#if [ -d "./datas/$clustername" ]; then
|
||||||
|
# echo "Import datas for $clustername"
|
||||||
|
# oc-k8s upgrade db -d opencloud -r $clustername -n $clustername -f ./datas/$clustername
|
||||||
|
#fi
|
||||||
17
k8s/stop.sh
Executable file
17
k8s/stop.sh
Executable file
@@ -0,0 +1,17 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
mode=${1:-dev}
|
||||||
|
branch=${2:-main}
|
||||||
|
|
||||||
|
if [ ! -d "oc-k8s" ];
|
||||||
|
echo "Cloning repository: $repo_name"
|
||||||
|
git clone "https://cloud.o-forge.io/core/oc-k8s.git"
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
echo "Error cloning oc-k8s"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
echo "Repository 'oc-k8s' already exists. Pulling latest changes..."
|
||||||
|
cd "oc-k8s" && git checkout $branch && git pull
|
||||||
|
|
||||||
|
./oc-k8s.sh stop $mode
|
||||||
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
---
|
|
||||||
|
|
||||||
version: 0.1.0
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
---
|
|
||||||
# Définition d'une version
|
|
||||||
|
|
||||||
version: 1.0
|
|
||||||
|
|
||||||
tools:
|
|
||||||
- name: kubectl
|
|
||||||
url: https://dl.k8s.io/release/%s/bin/linux/amd64/kubectl
|
|
||||||
version: v1.31.0
|
|
||||||
- name: helm
|
|
||||||
url: https://get.helm.sh/helm-%s-linux-amd64.tar.gz
|
|
||||||
version: v3.16.0
|
|
||||||
|
|
||||||
# helm install my-release <repo>/<chart>
|
|
||||||
opencloud:
|
|
||||||
- repository:
|
|
||||||
name: bitnami
|
|
||||||
url: https://charts.bitnami.com/bitnami # Repository des Charts
|
|
||||||
charts:
|
|
||||||
- name: wordpress
|
|
||||||
chart: bitnami/wordpress
|
|
||||||
version: 23.1.0
|
|
||||||
values: {}
|
|
||||||
helm_opts: --wait-for-jobs
|
|
||||||
helm_filevalues: values-init.yml
|
|
||||||
|
|
||||||
- name: phpmyadmin
|
|
||||||
chart: bitnami/phpmyadmin
|
|
||||||
version: 17.0.4
|
|
||||||
values: {}
|
|
||||||
|
|
||||||
- charts:
|
|
||||||
- name: mongo
|
|
||||||
chart: ../oc-mongo/mongo
|
|
||||||
|
|
||||||
- charts:
|
|
||||||
- name: myfirstrelease
|
|
||||||
chart: myfirstchart-0.1.0.tgz
|
|
||||||
url: https://zzzz/myfirstchart-0.1.0.tgz
|
|
||||||
|
|
||||||
# helm install myfirstrelease myfirstchart-0.1.0.tgz
|
|
||||||
3
publish/.gitignore
vendored
3
publish/.gitignore
vendored
@@ -1,3 +0,0 @@
|
|||||||
go.sum
|
|
||||||
*_
|
|
||||||
.coverage.*
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
module oc-publish
|
|
||||||
|
|
||||||
go 1.22.2
|
|
||||||
@@ -1,83 +0,0 @@
|
|||||||
package main
|
|
||||||
|
|
||||||
import (
|
|
||||||
"fmt"
|
|
||||||
"os"
|
|
||||||
"io/ioutil"
|
|
||||||
"encoding/base64"
|
|
||||||
"oc-publish/releases"
|
|
||||||
"oc-publish/occonst"
|
|
||||||
)
|
|
||||||
|
|
||||||
func main() {
|
|
||||||
|
|
||||||
version := os.Args[1]
|
|
||||||
|
|
||||||
fmt.Printf(" >> oc-publish :\n")
|
|
||||||
|
|
||||||
fmt.Printf(" << Url : %s/%s\n", occonst.PUBLISH_URL, occonst.PUBLISH_REPO)
|
|
||||||
|
|
||||||
fmt.Printf(" << version : %s %s\n", version, occonst.PUBLISH_BRANCH)
|
|
||||||
|
|
||||||
vversion := fmt.Sprintf("v%s", version)
|
|
||||||
existe, _ := releases.CheckRelease(vversion)
|
|
||||||
|
|
||||||
if existe == false {
|
|
||||||
err := releases.CreateRelease(vversion, occonst.PUBLISH_BRANCH)
|
|
||||||
if err != nil {
|
|
||||||
fmt.Println(err)
|
|
||||||
os.Exit(1)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
idRelease, _ := releases.GetReleaseId(vversion)
|
|
||||||
if existe == true {
|
|
||||||
fmt.Println(fmt.Sprintf(" << Release existante : %d ", idRelease))
|
|
||||||
} else {
|
|
||||||
fmt.Println(fmt.Sprintf(" << Release crée : %d ", idRelease))
|
|
||||||
}
|
|
||||||
|
|
||||||
assetname := "oc-deploy.base64"
|
|
||||||
binary := fmt.Sprintf("../bin/oc-deploy")
|
|
||||||
binary64 := fmt.Sprintf("../%s", assetname)
|
|
||||||
err := createBinaryFile(binary, binary64)
|
|
||||||
if err != nil {
|
|
||||||
fmt.Println(err)
|
|
||||||
os.Exit(1)
|
|
||||||
}
|
|
||||||
|
|
||||||
idAsset, _ := releases.GetAssetId(idRelease, assetname)
|
|
||||||
if idAsset == 0 {
|
|
||||||
fmt.Println(fmt.Sprintf(" << Ajout Asset : %s", assetname))
|
|
||||||
err := releases.CreateAsset(idRelease, binary64, assetname)
|
|
||||||
if err != nil {
|
|
||||||
fmt.Println(err)
|
|
||||||
os.Exit(1)
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
fmt.Println(fmt.Sprintf(" << Mise à jour : %s (idAsset=%d) ", assetname, idAsset))
|
|
||||||
err := releases.UpdateAsset(idRelease, idAsset, binary64, assetname)
|
|
||||||
if err != nil {
|
|
||||||
fmt.Println(err)
|
|
||||||
os.Exit(1)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
func createBinaryFile(source string, dest string) error {
|
|
||||||
fout, _ := os.Create(dest)
|
|
||||||
defer fout.Close()
|
|
||||||
|
|
||||||
byteValue, err := ioutil.ReadFile(source)
|
|
||||||
if err != nil {
|
|
||||||
fmt.Println("64e", err)
|
|
||||||
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
data64 := base64.StdEncoding.EncodeToString(byteValue)
|
|
||||||
fout.Write([]byte(data64))
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
package occonst
|
|
||||||
|
|
||||||
import (
|
|
||||||
"os"
|
|
||||||
)
|
|
||||||
|
|
||||||
var PUBLISH_URL = getenv("PUBLISH_URL", "https://cloud.o-forge.io")
|
|
||||||
var PUBLISH_REPO = getenv("PUBLISH_REPO", "core/oc-deploy")
|
|
||||||
var PUBLISH_TOKEN = getenv("PUBLISH_TOKEN", "")
|
|
||||||
var PUBLISH_BRANCH = getenv("PUBLISH_BRANCH", "main")
|
|
||||||
|
|
||||||
func getenv(key string, defaut string) string {
|
|
||||||
value := os.Getenv(key)
|
|
||||||
if len(value) == 0 {
|
|
||||||
return defaut
|
|
||||||
}
|
|
||||||
return value
|
|
||||||
}
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
Version %s d'OpenCloud
|
|
||||||
|
|
||||||
```
|
|
||||||
wget %s/%s/releases/download/%s/oc-deploy.base64 -O - | base64 -d > oc-deploy
|
|
||||||
chmod u+x ./oc-deploy
|
|
||||||
```
|
|
||||||
@@ -1,145 +0,0 @@
|
|||||||
package releases
|
|
||||||
|
|
||||||
import (
|
|
||||||
"fmt"
|
|
||||||
"os"
|
|
||||||
"path/filepath"
|
|
||||||
"mime/multipart"
|
|
||||||
"io"
|
|
||||||
"io/ioutil"
|
|
||||||
"encoding/json"
|
|
||||||
"net/http"
|
|
||||||
"bytes"
|
|
||||||
|
|
||||||
"oc-publish/occonst"
|
|
||||||
)
|
|
||||||
|
|
||||||
type assetStruct struct {
|
|
||||||
Name string `json:"name"`
|
|
||||||
Id int `json:"id"`
|
|
||||||
}
|
|
||||||
|
|
||||||
func GetAssetId(idRelease int, name string) (int, error) {
|
|
||||||
url := fmt.Sprintf("%s/api/v1/repos/%s/releases/%d/assets",
|
|
||||||
occonst.PUBLISH_URL,
|
|
||||||
occonst.PUBLISH_REPO,
|
|
||||||
idRelease)
|
|
||||||
|
|
||||||
res, err := http.Get(url)
|
|
||||||
if err != nil {
|
|
||||||
return -1, err
|
|
||||||
}
|
|
||||||
body, err := io.ReadAll(res.Body)
|
|
||||||
if err != nil {
|
|
||||||
return -2, err
|
|
||||||
}
|
|
||||||
|
|
||||||
var data []assetStruct
|
|
||||||
|
|
||||||
err = json.Unmarshal(body, &data)
|
|
||||||
if err != nil {
|
|
||||||
return -3, err
|
|
||||||
}
|
|
||||||
|
|
||||||
for _, ele := range data {
|
|
||||||
if ele.Name == name {
|
|
||||||
return ele.Id, nil
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return 0, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// curl -X 'POST' \
|
|
||||||
// 'https://cloud.o-forge.io/api/v1/repos/core/oc-deploy/releases/2/assets?name=zzzz' \
|
|
||||||
// -H 'accept: application/json' \
|
|
||||||
// -H 'Content-Type: multipart/form-data' \
|
|
||||||
// -F 'attachment=oc-deploy'
|
|
||||||
func CreateAsset(idRelease int, filename string, name string) (error) {
|
|
||||||
url := fmt.Sprintf("%s/api/v1/repos/%s/releases/%d/assets?name=%s&token=%s",
|
|
||||||
occonst.PUBLISH_URL,
|
|
||||||
occonst.PUBLISH_REPO,
|
|
||||||
idRelease,
|
|
||||||
name,
|
|
||||||
occonst.PUBLISH_TOKEN)
|
|
||||||
|
|
||||||
err := uploadFile(url, "attachment", filename)
|
|
||||||
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
func UpdateAsset(idRelease int, idAsset int, filename string, name string) (error) {
|
|
||||||
|
|
||||||
url := fmt.Sprintf("%s/api/v1/repos/%s/releases/%d/assets/%d?token=%s",
|
|
||||||
occonst.PUBLISH_URL,
|
|
||||||
occonst.PUBLISH_REPO,
|
|
||||||
idRelease,
|
|
||||||
idAsset,
|
|
||||||
occonst.PUBLISH_TOKEN)
|
|
||||||
|
|
||||||
// Create client
|
|
||||||
client := &http.Client{}
|
|
||||||
|
|
||||||
// Create request
|
|
||||||
req, err := http.NewRequest("DELETE", url, nil)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
// Fetch Request
|
|
||||||
resp, err := client.Do(req)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
defer resp.Body.Close()
|
|
||||||
|
|
||||||
// Read Response Body
|
|
||||||
respBody, err := ioutil.ReadAll(resp.Body)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
fmt.Println(string(respBody))
|
|
||||||
|
|
||||||
return CreateAsset(idRelease, filename, name)
|
|
||||||
}
|
|
||||||
|
|
||||||
func uploadFile(url string, paramName string, filePath string) error {
|
|
||||||
file, err := os.Open(filePath)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
defer file.Close()
|
|
||||||
|
|
||||||
body := &bytes.Buffer{}
|
|
||||||
writer := multipart.NewWriter(body)
|
|
||||||
part, err := writer.CreateFormFile(paramName, filepath.Base(filePath))
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
_, err = io.Copy(part, file)
|
|
||||||
|
|
||||||
err = writer.Close()
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
request, err := http.NewRequest("POST", url, body)
|
|
||||||
request.Header.Add("Content-Type", writer.FormDataContentType())
|
|
||||||
request.Header.Add("accept", "application/json")
|
|
||||||
client := &http.Client{}
|
|
||||||
response, err := client.Do(request)
|
|
||||||
|
|
||||||
if err != nil {
|
|
||||||
fmt.Println(109, err)
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
defer response.Body.Close()
|
|
||||||
|
|
||||||
if response.StatusCode > 400 {
|
|
||||||
return fmt.Errorf(response.Status)
|
|
||||||
}
|
|
||||||
|
|
||||||
_, err1 := io.ReadAll(response.Body)
|
|
||||||
|
|
||||||
// Handle the server response...
|
|
||||||
return err1
|
|
||||||
}
|
|
||||||
@@ -1,126 +0,0 @@
|
|||||||
package releases
|
|
||||||
|
|
||||||
import (
|
|
||||||
"fmt"
|
|
||||||
"io"
|
|
||||||
"io/ioutil"
|
|
||||||
"strings"
|
|
||||||
"encoding/json"
|
|
||||||
"net/http"
|
|
||||||
|
|
||||||
"oc-publish/occonst"
|
|
||||||
)
|
|
||||||
|
|
||||||
type checkStruct struct {
|
|
||||||
Name string `json:"name"`
|
|
||||||
Id int `json:"id"`
|
|
||||||
}
|
|
||||||
|
|
||||||
func CheckRelease(version string) (bool, error) {
|
|
||||||
url := fmt.Sprintf("%s/api/v1/repos/%s/releases",
|
|
||||||
occonst.PUBLISH_URL,
|
|
||||||
occonst.PUBLISH_REPO)
|
|
||||||
|
|
||||||
res, err := http.Get(url)
|
|
||||||
if err != nil {
|
|
||||||
return false, err
|
|
||||||
}
|
|
||||||
body, err := io.ReadAll(res.Body)
|
|
||||||
if err != nil {
|
|
||||||
return false, err
|
|
||||||
}
|
|
||||||
|
|
||||||
var data []checkStruct
|
|
||||||
err = json.Unmarshal(body, &data)
|
|
||||||
if err != nil {
|
|
||||||
return false, err
|
|
||||||
}
|
|
||||||
|
|
||||||
for _, ele := range data {
|
|
||||||
if ele.Name == version {
|
|
||||||
return true, nil
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// return data.Name != "", nil
|
|
||||||
return false, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func GetReleaseId(version string) (int, error) {
|
|
||||||
url := fmt.Sprintf("%s/api/v1/repos/%s/releases/tags/%s",
|
|
||||||
occonst.PUBLISH_URL,
|
|
||||||
occonst.PUBLISH_REPO,
|
|
||||||
version)
|
|
||||||
|
|
||||||
res, err := http.Get(url)
|
|
||||||
if err != nil {
|
|
||||||
return 0, err
|
|
||||||
}
|
|
||||||
body, err := io.ReadAll(res.Body)
|
|
||||||
if err != nil {
|
|
||||||
return 0, err
|
|
||||||
}
|
|
||||||
|
|
||||||
var data checkStruct
|
|
||||||
err = json.Unmarshal(body, &data)
|
|
||||||
if err != nil {
|
|
||||||
return 0, err
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Id, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// curl -X 'POST' \
|
|
||||||
// 'https://cloud.o-forge.io/api/v1/repos/na/oc-version/releases?token=sss' \
|
|
||||||
// -H 'accept: application/json' \
|
|
||||||
// -H 'Content-Type: application/json' \
|
|
||||||
// -d '{
|
|
||||||
// "body": "string",
|
|
||||||
// "draft": true,
|
|
||||||
// "name": "string",
|
|
||||||
// "prerelease": true,
|
|
||||||
// "tag_name": "string",
|
|
||||||
// "target_commitish": "string"
|
|
||||||
// }'
|
|
||||||
func CreateRelease(version string, branch string) (error) {
|
|
||||||
url := fmt.Sprintf("%s/api/v1/repos/%s/releases?token=%s",
|
|
||||||
occonst.PUBLISH_URL,
|
|
||||||
occonst.PUBLISH_REPO,
|
|
||||||
occonst.PUBLISH_TOKEN)
|
|
||||||
|
|
||||||
releasebytes, err := ioutil.ReadFile("release.txt")
|
|
||||||
releasetxt := string(releasebytes)
|
|
||||||
releasetxt = strings.Replace(releasetxt, "\n", "\\n", -1)
|
|
||||||
releasetxt = fmt.Sprintf(releasetxt, version, occonst.PUBLISH_URL, occonst.PUBLISH_REPO, version)
|
|
||||||
|
|
||||||
body := fmt.Sprintf(`{
|
|
||||||
"body": "%s",
|
|
||||||
"draft": false,
|
|
||||||
"name": "%s",
|
|
||||||
"prerelease": false,
|
|
||||||
"tag_name": "%s",
|
|
||||||
"target_commitish": "%s"
|
|
||||||
}`, releasetxt, version, version, branch)
|
|
||||||
|
|
||||||
request, err := http.NewRequest("POST", url, strings.NewReader(body))
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
request.Header.Add("accept", "application/json")
|
|
||||||
request.Header.Add("Content-Type", "application/json")
|
|
||||||
|
|
||||||
client := &http.Client{}
|
|
||||||
response, err := client.Do(request)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
defer response.Body.Close()
|
|
||||||
|
|
||||||
_, err1 := io.ReadAll(response.Body)
|
|
||||||
// cnt, err1 := io.ReadAll(response.Body)
|
|
||||||
// fmt.Println(string(cnt))
|
|
||||||
|
|
||||||
if err1 != nil {
|
|
||||||
return err1
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
5
src/.gitignore
vendored
5
src/.gitignore
vendored
@@ -1,5 +0,0 @@
|
|||||||
go.sum
|
|
||||||
*_
|
|
||||||
.coverage.*
|
|
||||||
.*.log
|
|
||||||
workspace_*
|
|
||||||
101
src/Makefile
101
src/Makefile
@@ -1,101 +0,0 @@
|
|||||||
|
|
||||||
BIN_NAME := oc-deploy
|
|
||||||
|
|
||||||
BIN_OPTS :=
|
|
||||||
|
|
||||||
##################
|
|
||||||
|
|
||||||
SOURCES := $(wildcard *.go) $(wildcard */*.go)
|
|
||||||
BIN_DIR = ../bin/
|
|
||||||
|
|
||||||
PLUGINS := $(wildcard ../plugins/*/*.go)
|
|
||||||
OBJS := ${PLUGINS:.go=.so}
|
|
||||||
|
|
||||||
##################
|
|
||||||
DATE := $(shell date --iso-8601)
|
|
||||||
GOVERSION := $(shell go version)
|
|
||||||
VERSION := $(shell git describe --tags --abbrev=8 --dirty --always --long)
|
|
||||||
PREFIX := oc-deploy/occonst
|
|
||||||
|
|
||||||
LDFLAGS := "-X '${PREFIX}.Version=${VERSION}' -X '${PREFIX}.Date=${DATE}' -X '${PREFIX}.GoVersion=${GOVERSION}'"
|
|
||||||
|
|
||||||
##################
|
|
||||||
|
|
||||||
%.so: %.go
|
|
||||||
go build -buildmode=plugin -o $@ $<
|
|
||||||
|
|
||||||
help:
|
|
||||||
@echo
|
|
||||||
@echo 'Usage:'
|
|
||||||
@echo ' make build Génère les exécutables.'
|
|
||||||
@echo ' make get-deps Dependency download'
|
|
||||||
|
|
||||||
@echo ' make run BIN_OPTS=... Go run'
|
|
||||||
@echo ' make run_install BIN_OPTS=... Go run'
|
|
||||||
@echo ' make run_uninstall BIN_OPTS=... Go run'
|
|
||||||
@echo ' make run_version Go run'
|
|
||||||
@echo ' make exec BIN_OPTS=... exécutable'
|
|
||||||
@echo ' make exec_install BIN_OPTS=... exécutable'
|
|
||||||
@echo ' make exec_uninstall BIN_OPTS=... exécutable'
|
|
||||||
@echo ' make exec_version exécutable'
|
|
||||||
|
|
||||||
@echo ' make test Test'
|
|
||||||
@echo ' make clean Clean the directory tree.'
|
|
||||||
@echo
|
|
||||||
|
|
||||||
@echo ' DATE ${DATE}'
|
|
||||||
@echo ' GOVERSION ${GOVERSION}'
|
|
||||||
@echo ' VERSION ${VERSION}'
|
|
||||||
@echo
|
|
||||||
|
|
||||||
${BIN_DIR}/${BIN_NAME}: ${SOURCES} $(OBJS)
|
|
||||||
go build -o ${BIN_DIR}/${BIN_NAME} -ldflags ${LDFLAGS}
|
|
||||||
|
|
||||||
get-deps:
|
|
||||||
@go mod tidy
|
|
||||||
|
|
||||||
build: ${BIN_DIR}/${BIN_NAME}
|
|
||||||
|
|
||||||
run:
|
|
||||||
@go run main.go ${BIN_OPTS}
|
|
||||||
|
|
||||||
run_generate:
|
|
||||||
@go run main.go generate ${BIN_OPTS}
|
|
||||||
|
|
||||||
run_install:
|
|
||||||
@go run main.go install ${BIN_OPTS}
|
|
||||||
|
|
||||||
run_uninstall:
|
|
||||||
@go run main.go uninstall ${BIN_OPTS}
|
|
||||||
|
|
||||||
run_version:
|
|
||||||
@go run main.go version
|
|
||||||
|
|
||||||
exec: ${BIN_DIR}/${BIN_NAME} $(OBJS)
|
|
||||||
@${BIN_DIR}/${BIN_NAME} ${BIN_OPTS}
|
|
||||||
|
|
||||||
exec_install: ${BIN_DIR}/${BIN_NAME} $(OBJS)
|
|
||||||
@${BIN_DIR}/${BIN_NAME} install ${BIN_OPTS}
|
|
||||||
|
|
||||||
exec_uninstall: ${BIN_DIR}/${BIN_NAME} $(OBJS)
|
|
||||||
@${BIN_DIR}/${BIN_NAME} uninstall ${BIN_OPTS}
|
|
||||||
|
|
||||||
exec_version: ${BIN_DIR}/${BIN_NAME} $(OBJS)
|
|
||||||
@${BIN_DIR}/${BIN_NAME} version
|
|
||||||
|
|
||||||
clean:
|
|
||||||
@test ! -e ${BIN_DIR}/${BIN_NAME} || rm ${BIN_DIR}/${BIN_NAME}
|
|
||||||
@test ! -e .coverage.out || rm .coverage.out
|
|
||||||
@test ! -e .coverage.html || rm .coverage.html
|
|
||||||
@test ! -e go.sum || rm go.sum
|
|
||||||
@test ! -e .oc-deploy.log || rm .oc-deploy.log
|
|
||||||
@rm -rf workspace_*
|
|
||||||
|
|
||||||
.PHONY: test
|
|
||||||
test_%:
|
|
||||||
go test oc-deploy/$(subst test_,,$@) -coverprofile=.coverage.out -v
|
|
||||||
@go tool cover -html=.coverage.out -o .coverage.html
|
|
||||||
|
|
||||||
test:
|
|
||||||
@go test ./... -coverprofile=.coverage.out -v
|
|
||||||
go tool cover -html=.coverage.out -o .coverage.html
|
|
||||||
@@ -1,58 +0,0 @@
|
|||||||
# Purpose
|
|
||||||
|
|
||||||
**oc-deploy** is a tool to deploy (with **helm**) all component of **OpenCloud**.
|
|
||||||
|
|
||||||
# Development
|
|
||||||
|
|
||||||
To init:
|
|
||||||
|
|
||||||
```
|
|
||||||
make get-deps
|
|
||||||
```
|
|
||||||
|
|
||||||
## To build
|
|
||||||
|
|
||||||
```
|
|
||||||
make build
|
|
||||||
```
|
|
||||||
|
|
||||||
## To run
|
|
||||||
|
|
||||||
```
|
|
||||||
make run_install [BIN_OPTS="<args>"]
|
|
||||||
make run_uninstall [BIN_OPTS="<args>"]
|
|
||||||
make run_generate [BIN_OPTS="<args>"]
|
|
||||||
```
|
|
||||||
|
|
||||||
or
|
|
||||||
|
|
||||||
```
|
|
||||||
make exec_install [BIN_OPTS="<args>"]
|
|
||||||
make exec_uninstall [BIN_OPTS="<args>"]
|
|
||||||
make exec_generate [BIN_OPTS="<args>"]
|
|
||||||
```
|
|
||||||
|
|
||||||
# To Test
|
|
||||||
|
|
||||||
All packages:
|
|
||||||
|
|
||||||
```
|
|
||||||
make test
|
|
||||||
```
|
|
||||||
|
|
||||||
or to test an specific package:
|
|
||||||
|
|
||||||
```
|
|
||||||
make test_<package>
|
|
||||||
```
|
|
||||||
|
|
||||||
Test generate _.coverage.html_ file to view the coverage of test.
|
|
||||||
|
|
||||||
## To Publish
|
|
||||||
|
|
||||||
Cf : ../publish
|
|
||||||
|
|
||||||
## Divers
|
|
||||||
|
|
||||||
* Latest version for _kubectl_: https://dl.k8s.io/release/stable.txt
|
|
||||||
* Release for _helm_: https://github.com/helm/helm/releases
|
|
||||||
@@ -1,51 +0,0 @@
|
|||||||
package chart
|
|
||||||
|
|
||||||
import (
|
|
||||||
"os"
|
|
||||||
"gopkg.in/yaml.v2"
|
|
||||||
)
|
|
||||||
|
|
||||||
type ChartData struct {
|
|
||||||
Name string `yaml:"name"`
|
|
||||||
Chart string `yaml:"chart"`
|
|
||||||
Url string `yaml:"url"`
|
|
||||||
Version string `yaml:"version"`
|
|
||||||
|
|
||||||
Opts string `yaml:"helm_opts"`
|
|
||||||
Values map[string]string `yaml:"helm_values"`
|
|
||||||
FileValues []string `yaml:"helm_filevalues"`
|
|
||||||
|
|
||||||
Overwrite string `yaml:"helm_overwrite"`
|
|
||||||
}
|
|
||||||
|
|
||||||
type repoData struct {
|
|
||||||
Name string `yaml:"name"`
|
|
||||||
Url string `yaml:"url"`
|
|
||||||
ForceUpdate bool `yaml:"forceupdate"`
|
|
||||||
Opts string `yaml:"opts"`
|
|
||||||
}
|
|
||||||
|
|
||||||
type ociData struct {
|
|
||||||
Url string `yaml:"url"`
|
|
||||||
}
|
|
||||||
|
|
||||||
type ChartRepoData struct {
|
|
||||||
Repository repoData `yaml:"repository"`
|
|
||||||
Oci ociData `yaml:"oci"`
|
|
||||||
Charts []ChartData `yaml:"charts"`
|
|
||||||
}
|
|
||||||
|
|
||||||
type chartsRepoParse struct {
|
|
||||||
Charts []ChartRepoData `yaml:"opencloud"`
|
|
||||||
}
|
|
||||||
|
|
||||||
func FromConfigFile(filename string) ([]ChartRepoData, error) {
|
|
||||||
yamlFile, _ := os.ReadFile(filename)
|
|
||||||
|
|
||||||
var data chartsRepoParse
|
|
||||||
err := yaml.Unmarshal(yamlFile, &data)
|
|
||||||
if err != nil {
|
|
||||||
return data.Charts, err
|
|
||||||
}
|
|
||||||
return data.Charts, nil
|
|
||||||
}
|
|
||||||
@@ -1,63 +0,0 @@
|
|||||||
package chart
|
|
||||||
|
|
||||||
import (
|
|
||||||
"testing"
|
|
||||||
"path/filepath"
|
|
||||||
"github.com/stretchr/testify/assert"
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
func _TestReadConfChart(t *testing.T) {
|
|
||||||
src := filepath.Join(TEST_SRC_DIR, "oc.yml")
|
|
||||||
|
|
||||||
assert.FileExists(t, src, "FromConfigFile error")
|
|
||||||
|
|
||||||
data, _ := FromConfigFile(src)
|
|
||||||
assert.Equal(t, "bitnami", data[0].Repository.Name, "FromConfigFile error")
|
|
||||||
assert.Equal(t, "https://charts.bitnami.com/bitnami", data[0].Repository.Url, "FromConfigFile error")
|
|
||||||
|
|
||||||
wordpress := data[0].Charts[0]
|
|
||||||
assert.Equal(t, "wordpress", wordpress.Name, "FromConfigFile error")
|
|
||||||
assert.Equal(t, "bitnami/wordpress", wordpress.Chart, "FromConfigFile error")
|
|
||||||
assert.Equal(t, "23.1.0", wordpress.Version, "FromConfigFile error")
|
|
||||||
assert.Equal(t, 0, len(wordpress.FileValues), "FromConfigFile error")
|
|
||||||
assert.Equal(t, 0, len(wordpress.Values), "FromConfigFile error")
|
|
||||||
|
|
||||||
phpmyadmin := data[0].Charts[1]
|
|
||||||
assert.Equal(t, "phpmyadmin", phpmyadmin.Name, "FromConfigFile error")
|
|
||||||
assert.Equal(t, "bitnami/phpmyadmin", phpmyadmin.Chart,"FromConfigFile error")
|
|
||||||
assert.Equal(t, "17.0.4", phpmyadmin.Version, "FromConfigFile error")
|
|
||||||
assert.Equal(t, 2, len(phpmyadmin.FileValues), "FromConfigFile error")
|
|
||||||
assert.Equal(t, 1, len(phpmyadmin.Values), "FromConfigFile error")
|
|
||||||
|
|
||||||
data1 := data[1]
|
|
||||||
assert.Equal(t, "", data1.Repository.Name, "FromConfigFile error")
|
|
||||||
assert.Equal(t, "", data1.Repository.Url, "FromConfigFile error")
|
|
||||||
|
|
||||||
myfirstrelease := data1.Charts[0]
|
|
||||||
assert.Equal(t, "myfirstrelease", myfirstrelease.Name, "FromConfigFile error")
|
|
||||||
assert.Equal(t, "https://zzzz/myfirstchart-0.1.0.tgz", myfirstrelease.Url, "FromConfigFile error")
|
|
||||||
}
|
|
||||||
|
|
||||||
func _TestReadConfChartOverwrite(t *testing.T){
|
|
||||||
src := filepath.Join(TEST_SRC_DIR, "oc_overwrite.yml")
|
|
||||||
|
|
||||||
assert.FileExists(t, src, "FromConfigFile error")
|
|
||||||
|
|
||||||
data, _ := FromConfigFile(src)
|
|
||||||
// Nombre de lettres
|
|
||||||
assert.Equal(t, 70, len(data[0].Charts[0].Overwrite), "TestReadConfChartOverwrite error")
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
func TestReadConfChartOci(t *testing.T) {
|
|
||||||
src := filepath.Join(TEST_SRC_DIR, "oc_oci.yml")
|
|
||||||
|
|
||||||
assert.FileExists(t, src, "FromConfigFile error")
|
|
||||||
|
|
||||||
data, _ := FromConfigFile(src)
|
|
||||||
assert.Equal(t, "", data[0].Repository.Name, "FromConfigFile error")
|
|
||||||
assert.Equal(t, "oci://harbor.dtf/dev", data[0].Oci.Url, "FromConfigFile error")
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
package chart
|
|
||||||
|
|
||||||
import (
|
|
||||||
"os"
|
|
||||||
"testing"
|
|
||||||
"path/filepath"
|
|
||||||
)
|
|
||||||
|
|
||||||
var TEST_DEST_DIR = "../wrk_chart"
|
|
||||||
var TEST_SRC_DIR = filepath.Join("../../test", "chart")
|
|
||||||
|
|
||||||
func TestMain(m *testing.M) {
|
|
||||||
folderPath := TEST_DEST_DIR
|
|
||||||
|
|
||||||
os.RemoveAll(folderPath)
|
|
||||||
os.MkdirAll(folderPath, os.ModePerm)
|
|
||||||
|
|
||||||
// call flag.Parse() here if TestMain uses flags
|
|
||||||
exitCode := m.Run()
|
|
||||||
|
|
||||||
os.RemoveAll(folderPath)
|
|
||||||
os.Exit(exitCode)
|
|
||||||
}
|
|
||||||
104
src/cmd/args.go
104
src/cmd/args.go
@@ -1,104 +0,0 @@
|
|||||||
// Package cmd : Parse les arguments
|
|
||||||
|
|
||||||
// Arguments : version ==> version d'OpenCloud
|
|
||||||
// Argument : projet ==> nom du projet
|
|
||||||
package cmd
|
|
||||||
|
|
||||||
import (
|
|
||||||
"github.com/spf13/cobra"
|
|
||||||
|
|
||||||
log "oc-deploy/log_wrapper"
|
|
||||||
)
|
|
||||||
|
|
||||||
var (
|
|
||||||
context string
|
|
||||||
version string
|
|
||||||
modules []string
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
func cobraInstallCmd() *cobra.Command {
|
|
||||||
return &cobra.Command{
|
|
||||||
Use: "install",
|
|
||||||
Short: "install",
|
|
||||||
Long: `deploy Charts`,
|
|
||||||
Args: cobra.MaximumNArgs(0),
|
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
|
||||||
log.Log().Info().Msg("oc-deploy :")
|
|
||||||
return InstallCmd(context, version, modules)
|
|
||||||
},
|
|
||||||
Example: "oc-deploy install --version 0.1.0 --context ex1",
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func cobraUninstallCmd() *cobra.Command{
|
|
||||||
return &cobra.Command{
|
|
||||||
Use: "uninstall",
|
|
||||||
Short: "undeploy",
|
|
||||||
Long: `Undeploy`,
|
|
||||||
Args: cobra.MaximumNArgs(0),
|
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
|
||||||
log.Log().Info().Msg("oc-deploy :")
|
|
||||||
return UninstallCmd(context, modules)
|
|
||||||
},
|
|
||||||
Example: "oc-deploy uninstall --context ex1",
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
func cobraGenerateCmd() *cobra.Command{
|
|
||||||
return &cobra.Command{
|
|
||||||
Use: "generate",
|
|
||||||
Short: "generate",
|
|
||||||
Long: "generate",
|
|
||||||
Args: cobra.MaximumNArgs(0),
|
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
|
||||||
log.Log().Info().Msg("oc-deploy :")
|
|
||||||
return GenerateCmd(context, version)
|
|
||||||
},
|
|
||||||
Example: "oc-deploy generate --version 0.1.0 --context ex1",
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func cobraVersionCmd() *cobra.Command{
|
|
||||||
return &cobra.Command{
|
|
||||||
Use: "version",
|
|
||||||
Short: "version",
|
|
||||||
Long: "Get Version",
|
|
||||||
Args: cobra.MaximumNArgs(0),
|
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
|
||||||
return VersionCmd()
|
|
||||||
},
|
|
||||||
Example: "oc-deploy version",
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func Execute() {
|
|
||||||
|
|
||||||
log.Log().Debug().Msg("Execute")
|
|
||||||
|
|
||||||
var rootCmd = &cobra.Command{Use: "oc-deploy"}
|
|
||||||
|
|
||||||
var cmdInstall = cobraInstallCmd()
|
|
||||||
var cmdUninstall = cobraUninstallCmd()
|
|
||||||
var cmdGenerate = cobraGenerateCmd()
|
|
||||||
var cmdVersion = cobraVersionCmd()
|
|
||||||
|
|
||||||
cmdInstall.Flags().StringVarP(&context, "context", "c", "opencloud", "Nom du context")
|
|
||||||
cmdInstall.Flags().StringVarP(&version, "version", "v", "latest", "Version")
|
|
||||||
cmdInstall.Flags().StringArrayVarP(&modules, "modules", "m", []string{}, "modules, ...")
|
|
||||||
|
|
||||||
cmdUninstall.Flags().StringVarP(&context, "context", "c", "opencloud", "Nom du context")
|
|
||||||
cmdUninstall.Flags().StringArrayVarP(&modules, "modules", "m", []string{}, "modules, ...")
|
|
||||||
|
|
||||||
cmdGenerate.Flags().StringVarP(&context, "context", "c", "opencloud", "Nom du context")
|
|
||||||
cmdGenerate.Flags().StringVarP(&version, "version", "v", "latest", "Version")
|
|
||||||
|
|
||||||
rootCmd.AddCommand(cmdInstall)
|
|
||||||
rootCmd.AddCommand(cmdUninstall)
|
|
||||||
rootCmd.AddCommand(cmdGenerate)
|
|
||||||
rootCmd.AddCommand(cmdVersion)
|
|
||||||
|
|
||||||
cobra.CheckErr(rootCmd.Execute())
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
package cmd
|
|
||||||
|
|
||||||
import (
|
|
||||||
"testing"
|
|
||||||
)
|
|
||||||
|
|
||||||
func TestExecute(t *testing.T) {
|
|
||||||
Execute()
|
|
||||||
}
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
package cmd
|
|
||||||
|
|
||||||
import (
|
|
||||||
"fmt"
|
|
||||||
log "oc-deploy/log_wrapper"
|
|
||||||
|
|
||||||
// "oc-deploy/versionOc"
|
|
||||||
"oc-deploy/install"
|
|
||||||
)
|
|
||||||
|
|
||||||
func GenerateCmd(prcontextoject string, version string) error {
|
|
||||||
log.Log().Info().Msg("Generate >> ")
|
|
||||||
|
|
||||||
workspace := fmt.Sprintf("workspace_%s", context)
|
|
||||||
|
|
||||||
obj := install.InstallClass{Workspace: workspace, Version: version}
|
|
||||||
_, err := obj.NewGenerate()
|
|
||||||
if err != nil {
|
|
||||||
log.Log().Fatal().Msg(" >> " + err.Error())
|
|
||||||
}
|
|
||||||
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
@@ -1,51 +0,0 @@
|
|||||||
package cmd
|
|
||||||
|
|
||||||
import (
|
|
||||||
"fmt"
|
|
||||||
log "oc-deploy/log_wrapper"
|
|
||||||
|
|
||||||
"oc-deploy/install"
|
|
||||||
)
|
|
||||||
|
|
||||||
func InstallCmd(context string, version string, modules []string) error {
|
|
||||||
log.Log().Info().Msg("Install >> ")
|
|
||||||
|
|
||||||
log.Log().Info().Msg(" << Contexte : " + context)
|
|
||||||
if len(modules) > 0 {
|
|
||||||
log.Log().Info().Msg(fmt.Sprintf(" << Modules : %s", modules))
|
|
||||||
}
|
|
||||||
|
|
||||||
workspace := fmt.Sprintf("workspace_%s", context)
|
|
||||||
obj := install.InstallClass{Workspace: workspace, Version: version}
|
|
||||||
|
|
||||||
file, err := obj.NewInstall()
|
|
||||||
if err != nil {
|
|
||||||
log.Log().Fatal().Msg(" >> " + err.Error())
|
|
||||||
}
|
|
||||||
log.Log().Info().Msg(fmt.Sprintf(" << Version : %s", obj.Version))
|
|
||||||
log.Log().Info().Msg(fmt.Sprintf(" >> Config : %s", file))
|
|
||||||
|
|
||||||
err = obj.Tools()
|
|
||||||
if err != nil {
|
|
||||||
log.Log().Fatal().Msg(" >> " + err.Error())
|
|
||||||
}
|
|
||||||
|
|
||||||
obj.SetCommands()
|
|
||||||
|
|
||||||
err = obj.ChartRepo()
|
|
||||||
if err != nil {
|
|
||||||
log.Log().Fatal().Msg(" >> " + err.Error())
|
|
||||||
}
|
|
||||||
|
|
||||||
err = obj.K8s(context)
|
|
||||||
if err != nil {
|
|
||||||
log.Log().Fatal().Msg(" >> " + err.Error())
|
|
||||||
}
|
|
||||||
|
|
||||||
err = obj.InstallCharts(modules)
|
|
||||||
if err != nil {
|
|
||||||
log.Log().Fatal().Msg(" >> " + err.Error())
|
|
||||||
}
|
|
||||||
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
package cmd
|
|
||||||
|
|
||||||
import (
|
|
||||||
"bytes"
|
|
||||||
"github.com/spf13/cobra"
|
|
||||||
|
|
||||||
"testing"
|
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
|
||||||
)
|
|
||||||
|
|
||||||
func TestInstallCommand(t *testing.T) {
|
|
||||||
cmd := cobraInstallCmd()
|
|
||||||
|
|
||||||
inMock := false
|
|
||||||
cmd.RunE = func(cmd *cobra.Command, args []string) error {
|
|
||||||
inMock = true
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
cmd.Execute()
|
|
||||||
assert.Truef(t, inMock, "TestInstallCommand")
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestInstallCommandErr(t *testing.T) {
|
|
||||||
cmd := cobraUninstallCmd()
|
|
||||||
|
|
||||||
inMock := false
|
|
||||||
cmd.RunE = func(cmd *cobra.Command, args []string) error {
|
|
||||||
inMock = true
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
cmd.SetArgs([]string{"bad"})
|
|
||||||
b := bytes.NewBufferString("")
|
|
||||||
cmd.SetOut(b)
|
|
||||||
|
|
||||||
err := cmd.Execute()
|
|
||||||
assert.Falsef(t, inMock, "TestInstallCommand args")
|
|
||||||
assert.NotNilf(t, err, "TestInstallCommand args")
|
|
||||||
}
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
package cmd
|
|
||||||
|
|
||||||
import (
|
|
||||||
"fmt"
|
|
||||||
|
|
||||||
log "oc-deploy/log_wrapper"
|
|
||||||
|
|
||||||
"oc-deploy/install"
|
|
||||||
)
|
|
||||||
|
|
||||||
func UninstallCmd(context string, modules []string) error {
|
|
||||||
log.Log().Info().Msg("Uninstall >> ")
|
|
||||||
|
|
||||||
log.Log().Info().Msg(" << Contexte : " + context)
|
|
||||||
if len(modules) > 0 {
|
|
||||||
log.Log().Info().Msg(fmt.Sprintf(" << Modules : %s", modules))
|
|
||||||
}
|
|
||||||
|
|
||||||
workspace := fmt.Sprintf("workspace_%s", context)
|
|
||||||
obj := install.InstallClass{Workspace: workspace}
|
|
||||||
|
|
||||||
file, err := obj.NewUninstall()
|
|
||||||
if err != nil {
|
|
||||||
log.Log().Fatal().Msg(" >> " + err.Error())
|
|
||||||
}
|
|
||||||
log.Log().Info().Msg(fmt.Sprintf(" << Version : %s", obj.Version))
|
|
||||||
log.Log().Info().Msg(fmt.Sprintf(" >> Config : %s", file))
|
|
||||||
|
|
||||||
err = obj.Tools()
|
|
||||||
if err != nil {
|
|
||||||
log.Log().Fatal().Msg(" >> " + err.Error())
|
|
||||||
}
|
|
||||||
|
|
||||||
obj.SetCommands()
|
|
||||||
|
|
||||||
err = obj.K8s(context)
|
|
||||||
if err != nil {
|
|
||||||
log.Log().Fatal().Msg(" >> " + err.Error())
|
|
||||||
}
|
|
||||||
|
|
||||||
err = obj.UninstallCharts(modules)
|
|
||||||
if err != nil {
|
|
||||||
log.Log().Fatal().Msg(" >> " + err.Error())
|
|
||||||
}
|
|
||||||
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
package cmd
|
|
||||||
|
|
||||||
import (
|
|
||||||
"bytes"
|
|
||||||
"github.com/spf13/cobra"
|
|
||||||
|
|
||||||
"testing"
|
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
|
||||||
)
|
|
||||||
|
|
||||||
func TestUninstallCommand(t *testing.T) {
|
|
||||||
cmd := cobraUninstallCmd()
|
|
||||||
|
|
||||||
inMock := false
|
|
||||||
cmd.RunE = func(cmd *cobra.Command, args []string) error {
|
|
||||||
inMock = true
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
cmd.Execute()
|
|
||||||
assert.Truef(t, inMock, "TestUninstallCommand")
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestUninstallCommandErr(t *testing.T) {
|
|
||||||
cmd := cobraUninstallCmd()
|
|
||||||
|
|
||||||
inMock := false
|
|
||||||
cmd.RunE = func(cmd *cobra.Command, args []string) error {
|
|
||||||
inMock = true
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
cmd.SetArgs([]string{"bad"})
|
|
||||||
b := bytes.NewBufferString("")
|
|
||||||
cmd.SetOut(b)
|
|
||||||
|
|
||||||
err := cmd.Execute()
|
|
||||||
assert.Falsef(t, inMock, "TestUninstallCommand args")
|
|
||||||
assert.NotNilf(t, err, "TestUninstallCommand args")
|
|
||||||
}
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
package cmd
|
|
||||||
|
|
||||||
import (
|
|
||||||
"fmt"
|
|
||||||
"oc-deploy/occonst"
|
|
||||||
log "oc-deploy/log_wrapper"
|
|
||||||
)
|
|
||||||
|
|
||||||
func VersionCmd() error {
|
|
||||||
|
|
||||||
version := occonst.Version
|
|
||||||
date := occonst.Date
|
|
||||||
goversion := occonst.GoVersion
|
|
||||||
|
|
||||||
log.Log().Debug().Msg(fmt.Sprintf("Version : %s (%s) ; GoVersion : %s", version, date, goversion))
|
|
||||||
fmt.Println(version)
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
25
src/go.mod
25
src/go.mod
@@ -1,25 +0,0 @@
|
|||||||
module oc-deploy
|
|
||||||
|
|
||||||
go 1.22.0
|
|
||||||
|
|
||||||
require (
|
|
||||||
github.com/jarcoal/httpmock v1.3.1
|
|
||||||
github.com/rs/zerolog v1.33.0
|
|
||||||
github.com/spf13/cobra v1.8.1
|
|
||||||
github.com/stretchr/testify v1.9.0
|
|
||||||
gopkg.in/yaml.v2 v2.4.0
|
|
||||||
)
|
|
||||||
|
|
||||||
require (
|
|
||||||
github.com/davecgh/go-spew v1.1.1 // indirect
|
|
||||||
github.com/inconshreveable/mousetrap v1.1.0 // indirect
|
|
||||||
github.com/kr/pretty v0.3.1 // indirect
|
|
||||||
github.com/mattn/go-colorable v0.1.13 // indirect
|
|
||||||
github.com/mattn/go-isatty v0.0.20 // indirect
|
|
||||||
github.com/pmezard/go-difflib v1.0.0 // indirect
|
|
||||||
github.com/rogpeppe/go-internal v1.11.0 // indirect
|
|
||||||
github.com/spf13/pflag v1.0.5 // indirect
|
|
||||||
golang.org/x/sys v0.22.0 // indirect
|
|
||||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
|
|
||||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
|
||||||
)
|
|
||||||
@@ -1,169 +0,0 @@
|
|||||||
package helm
|
|
||||||
|
|
||||||
import (
|
|
||||||
"fmt"
|
|
||||||
"strconv"
|
|
||||||
"os"
|
|
||||||
"strings"
|
|
||||||
"errors"
|
|
||||||
"path/filepath"
|
|
||||||
"encoding/json"
|
|
||||||
log "oc-deploy/log_wrapper"
|
|
||||||
)
|
|
||||||
|
|
||||||
type HelmChart struct {
|
|
||||||
Bin string
|
|
||||||
Name string
|
|
||||||
Chart string
|
|
||||||
Version string
|
|
||||||
Url string
|
|
||||||
|
|
||||||
Workspace string
|
|
||||||
Opts string
|
|
||||||
Values map[string]string
|
|
||||||
FileValues []string
|
|
||||||
}
|
|
||||||
|
|
||||||
type installInfoOutput struct {
|
|
||||||
Description string `json:"description"`
|
|
||||||
Notes string `json:"notes"`
|
|
||||||
Status string `json:"status"`
|
|
||||||
}
|
|
||||||
|
|
||||||
type installOutput struct {
|
|
||||||
Info installInfoOutput `json:"info"`
|
|
||||||
}
|
|
||||||
|
|
||||||
func (this HelmCommand) ChartInstall(data HelmChart) (string, error) {
|
|
||||||
bin := this.Bin
|
|
||||||
|
|
||||||
existe, err := this.chartExists(data)
|
|
||||||
if err != nil {
|
|
||||||
return "", err
|
|
||||||
}
|
|
||||||
|
|
||||||
if existe {
|
|
||||||
return "Existe déjà", nil
|
|
||||||
}
|
|
||||||
|
|
||||||
ficChart := data.Chart
|
|
||||||
// Recherche locale
|
|
||||||
if _, err := os.Stat(ficChart); err != nil {
|
|
||||||
} else {
|
|
||||||
// Recherche voa le Workspace
|
|
||||||
ficChart := filepath.Join(data.Workspace, data.Chart)
|
|
||||||
if _, err := os.Stat(ficChart); err == nil {
|
|
||||||
} else {
|
|
||||||
if data.Url != "" {
|
|
||||||
fmt.Println("============ 52 Télechargement", data.Url)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
msg := fmt.Sprintf("%s install %s %s %s --output json", bin, data.Name, ficChart, data.Opts)
|
|
||||||
|
|
||||||
if data.Version != "" {
|
|
||||||
msg = fmt.Sprintf("%s --version %s", msg, data.Version)
|
|
||||||
}
|
|
||||||
|
|
||||||
for key, value := range data.Values {
|
|
||||||
msg = fmt.Sprintf("%s --set %s=%s", msg, key, value)
|
|
||||||
}
|
|
||||||
|
|
||||||
ficoverwrite := filepath.Join(data.Workspace, fmt.Sprintf("value-%s.yml", data.Name))
|
|
||||||
if _, err := os.Stat(ficoverwrite); err != nil {
|
|
||||||
log.Log().Warn().Msg(ficoverwrite)
|
|
||||||
} else {
|
|
||||||
msg = fmt.Sprintf("%s --values %s", msg, ficoverwrite)
|
|
||||||
}
|
|
||||||
|
|
||||||
for _, valuefilename := range data.FileValues {
|
|
||||||
fic := filepath.Join(data.Workspace, valuefilename)
|
|
||||||
if _, err := os.Stat(fic); err != nil {
|
|
||||||
log.Log().Warn().Msg(fic)
|
|
||||||
} else {
|
|
||||||
msg = fmt.Sprintf("%s --values %s", msg, fic)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
msg = strings.Replace(msg, " ", " ", -1)
|
|
||||||
|
|
||||||
log.Log().Debug().Msg(msg)
|
|
||||||
|
|
||||||
cmd_args := strings.Split(msg, " ")
|
|
||||||
cmd := this.Exec(cmd_args[0], cmd_args[1:]...)
|
|
||||||
stdout, err := cmd.CombinedOutput()
|
|
||||||
|
|
||||||
if err != nil {
|
|
||||||
res := string(stdout)
|
|
||||||
res = strings.TrimSuffix(res, "\n")
|
|
||||||
return "", errors.New(res)
|
|
||||||
}
|
|
||||||
|
|
||||||
var objmap installOutput
|
|
||||||
|
|
||||||
i := strings.Index(string(stdout), "{")
|
|
||||||
stdout2 := string(stdout)[i:]
|
|
||||||
|
|
||||||
err = json.Unmarshal([]byte(stdout2), &objmap)
|
|
||||||
if err != nil {
|
|
||||||
return "", err
|
|
||||||
}
|
|
||||||
|
|
||||||
res := objmap.Info.Status
|
|
||||||
|
|
||||||
return res, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (this HelmCommand) ChartUninstall(data HelmChart) (string, error) {
|
|
||||||
bin := this.Bin
|
|
||||||
|
|
||||||
log.Log().Info().Msg(" >> Chart : " + data.Name)
|
|
||||||
|
|
||||||
existe, err := this.chartExists(data)
|
|
||||||
if err != nil {
|
|
||||||
return "", err
|
|
||||||
}
|
|
||||||
if ! existe {
|
|
||||||
return "Non présent", nil
|
|
||||||
}
|
|
||||||
|
|
||||||
msg := fmt.Sprintf("%s uninstall %s", bin, data.Name)
|
|
||||||
log.Log().Debug().Msg(msg)
|
|
||||||
|
|
||||||
cmd_args := strings.Split(msg, " ")
|
|
||||||
cmd := this.Exec(cmd_args[0], cmd_args[1:]...)
|
|
||||||
stdout, err := cmd.CombinedOutput()
|
|
||||||
|
|
||||||
res := string(stdout)
|
|
||||||
res = strings.TrimSuffix(res, "\n")
|
|
||||||
|
|
||||||
log.Log().Debug().Msg(res)
|
|
||||||
|
|
||||||
return res, err
|
|
||||||
}
|
|
||||||
|
|
||||||
// ../bin/helm list --filter phpmyadminm --short
|
|
||||||
func (this HelmCommand) chartExists(data HelmChart) (bool, error) {
|
|
||||||
|
|
||||||
bin := this.Bin
|
|
||||||
|
|
||||||
msg := fmt.Sprintf("%s list --filter %s --no-headers", bin, data.Name)
|
|
||||||
log.Log().Debug().Msg(msg)
|
|
||||||
|
|
||||||
cmd_args := strings.Split(msg, " ")
|
|
||||||
cmd := this.Exec(cmd_args[0], cmd_args[1:]...)
|
|
||||||
stdout, err := cmd.CombinedOutput()
|
|
||||||
if err != nil {
|
|
||||||
log.Log().Debug().Msg(string(stdout))
|
|
||||||
return false, errors.New(string(stdout))
|
|
||||||
}
|
|
||||||
|
|
||||||
res := string(stdout)
|
|
||||||
res = strings.TrimSuffix(res, "\n")
|
|
||||||
|
|
||||||
log.Log().Debug().Msg(string(stdout))
|
|
||||||
log.Log().Debug().Msg(strconv.FormatBool(res != ""))
|
|
||||||
|
|
||||||
return res != "", nil
|
|
||||||
}
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
package helm
|
|
||||||
|
|
||||||
import (
|
|
||||||
"testing"
|
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
|
||||||
)
|
|
||||||
|
|
||||||
func TestHelmChartExists(t *testing.T){
|
|
||||||
|
|
||||||
cmd := getCmdHelm(true, `oc-catalog default 1 2024-09-06 16:01:49.17368605 +0200 CEST deployed oc-catalog-0.1.0 1.0`)
|
|
||||||
|
|
||||||
data := HelmChart{Name: "oc-catalog"}
|
|
||||||
res, err := cmd.chartExists(data)
|
|
||||||
|
|
||||||
assert.Nilf(t, err, "error message %s", err)
|
|
||||||
assert.Truef(t, res, "TestHelmVersion error")
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
func TestHelmChartNotExists(t *testing.T){
|
|
||||||
|
|
||||||
cmd := getCmdHelm(true, "\n")
|
|
||||||
|
|
||||||
data := HelmChart{Name: "phpmyadmin"}
|
|
||||||
res, err := cmd.chartExists(data)
|
|
||||||
|
|
||||||
assert.Nilf(t, err, "error message %s", err)
|
|
||||||
assert.Falsef(t, res, "TestHelmVersion error")
|
|
||||||
}
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
package helm
|
|
||||||
|
|
||||||
import (
|
|
||||||
"os/exec"
|
|
||||||
)
|
|
||||||
|
|
||||||
type HelmCommand struct {
|
|
||||||
Bin string
|
|
||||||
Exec func(string,...string) commandExecutor
|
|
||||||
}
|
|
||||||
|
|
||||||
////
|
|
||||||
type commandExecutor interface {
|
|
||||||
Output() ([]byte, error)
|
|
||||||
CombinedOutput() ([]byte, error)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (this *HelmCommand) New() {
|
|
||||||
this.Exec = func(name string, arg ...string) commandExecutor {
|
|
||||||
return exec.Command(name, arg...)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
package helm
|
|
||||||
|
|
||||||
|
|
||||||
import (
|
|
||||||
"testing"
|
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
|
||||||
)
|
|
||||||
|
|
||||||
func TestHelm(t *testing.T) {
|
|
||||||
cmd := HelmCommand{}
|
|
||||||
cmd.New()
|
|
||||||
|
|
||||||
assert.NotNilf(t, cmd.Exec, "TestHelm %s", "New")
|
|
||||||
|
|
||||||
cmd.Exec("pwd")
|
|
||||||
}
|
|
||||||
@@ -1,84 +0,0 @@
|
|||||||
package helm
|
|
||||||
|
|
||||||
import (
|
|
||||||
"os"
|
|
||||||
"strings"
|
|
||||||
"testing"
|
|
||||||
"path/filepath"
|
|
||||||
)
|
|
||||||
|
|
||||||
var TEST_DEST_DIR = "../wrk_helm"
|
|
||||||
var TEST_SRC_DIR = filepath.Join("../../test", "helm")
|
|
||||||
var TEST_BIN_DIR = filepath.Join("../../test", "bin")
|
|
||||||
|
|
||||||
func TestMain(m *testing.M) {
|
|
||||||
folderPath := TEST_DEST_DIR
|
|
||||||
|
|
||||||
os.RemoveAll(folderPath)
|
|
||||||
os.MkdirAll(folderPath, os.ModePerm)
|
|
||||||
|
|
||||||
// call flag.Parse() here if TestMain uses flags
|
|
||||||
exitCode := m.Run()
|
|
||||||
|
|
||||||
os.RemoveAll(folderPath)
|
|
||||||
os.Exit(exitCode)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Mock
|
|
||||||
|
|
||||||
type MockCommandExecutor struct {
|
|
||||||
// Used to stub the return of the Output method
|
|
||||||
// Could add other properties depending on testing needs
|
|
||||||
output string
|
|
||||||
}
|
|
||||||
|
|
||||||
// Implements the commandExecutor interface
|
|
||||||
func (m *MockCommandExecutor) Output() ([]byte, error) {
|
|
||||||
return []byte(m.output), nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *MockCommandExecutor) CombinedOutput() ([]byte, error) {
|
|
||||||
return []byte(m.output), nil
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
|
|
||||||
func getCmdHelm(mock bool, output string) (HelmCommand) {
|
|
||||||
if mock == true {
|
|
||||||
|
|
||||||
mock := func(name string, args ...string) commandExecutor {
|
|
||||||
return &MockCommandExecutor{output: output}
|
|
||||||
}
|
|
||||||
|
|
||||||
cmd := HelmCommand{Bin: "mock", Exec: mock}
|
|
||||||
return cmd
|
|
||||||
} else {
|
|
||||||
bin := filepath.Join(TEST_BIN_DIR, "helm")
|
|
||||||
os.Chmod(bin, 0700)
|
|
||||||
|
|
||||||
cmd := HelmCommand{Bin: bin}
|
|
||||||
cmd.New()
|
|
||||||
return cmd
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func getCmdsHelm(mock bool, outputs map[string]string) (HelmCommand) {
|
|
||||||
if mock == true {
|
|
||||||
|
|
||||||
mock := func(name string, args ...string) commandExecutor {
|
|
||||||
cmd := strings.TrimSuffix(strings.Join(args," "), " ")
|
|
||||||
output := outputs[cmd]
|
|
||||||
return &MockCommandExecutor{output: output}
|
|
||||||
}
|
|
||||||
|
|
||||||
cmd := HelmCommand{Bin: "mock", Exec: mock}
|
|
||||||
return cmd
|
|
||||||
} else {
|
|
||||||
bin := filepath.Join(TEST_BIN_DIR, "helm")
|
|
||||||
os.Chmod(bin, 0700)
|
|
||||||
|
|
||||||
cmd := HelmCommand{Bin: bin}
|
|
||||||
cmd.New()
|
|
||||||
return cmd
|
|
||||||
}
|
|
||||||
}
|
|
||||||
102
src/helm/repo.go
102
src/helm/repo.go
@@ -1,102 +0,0 @@
|
|||||||
package helm
|
|
||||||
|
|
||||||
import (
|
|
||||||
"fmt"
|
|
||||||
"strings"
|
|
||||||
"encoding/json"
|
|
||||||
|
|
||||||
log "oc-deploy/log_wrapper"
|
|
||||||
"oc-deploy/utils"
|
|
||||||
)
|
|
||||||
|
|
||||||
type HelmRepo struct {
|
|
||||||
Name string
|
|
||||||
Repository string // Url du dépôt
|
|
||||||
ForceUpdate bool
|
|
||||||
Opts string
|
|
||||||
}
|
|
||||||
|
|
||||||
func (this HelmCommand) AddRepository(repo HelmRepo) (string, error) {
|
|
||||||
|
|
||||||
helm_bin := this.Bin
|
|
||||||
|
|
||||||
force_update := "--force-update=false"
|
|
||||||
if repo.ForceUpdate {
|
|
||||||
force_update = "--force-update=true"
|
|
||||||
} else {
|
|
||||||
list, _ := this.ListRepository()
|
|
||||||
if utils.StringInSlice(repo.Name, list) {
|
|
||||||
return "Existe déjà", nil
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
msg := fmt.Sprintf("%s repo add %s %s %s %s", helm_bin, repo.Name, repo.Repository, force_update, repo.Opts)
|
|
||||||
|
|
||||||
msg = strings.TrimSuffix(msg, " ")
|
|
||||||
log.Log().Debug().Msg(msg)
|
|
||||||
|
|
||||||
cmd_args := strings.Split(msg, " ")
|
|
||||||
cmd := this.Exec(cmd_args[0], cmd_args[1:]...)
|
|
||||||
stdout, err := cmd.CombinedOutput()
|
|
||||||
if err != nil {
|
|
||||||
return "", fmt.Errorf(string(stdout))
|
|
||||||
}
|
|
||||||
|
|
||||||
res := string(stdout)
|
|
||||||
res = strings.TrimSuffix(res, "\n")
|
|
||||||
log.Log().Debug().Msg(res)
|
|
||||||
|
|
||||||
return res, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
type parseList struct {
|
|
||||||
Name string `json:"name"`
|
|
||||||
}
|
|
||||||
|
|
||||||
func (this HelmCommand) ListRepository() ([]string, error) {
|
|
||||||
|
|
||||||
helm_bin := this.Bin
|
|
||||||
res := make([]string, 0, 0)
|
|
||||||
|
|
||||||
msg := fmt.Sprintf("%s repo list -o json", helm_bin)
|
|
||||||
log.Log().Debug().Msg(msg)
|
|
||||||
|
|
||||||
cmd_args := strings.Split(msg, " ")
|
|
||||||
|
|
||||||
cmd := this.Exec(cmd_args[0], cmd_args[1:]...)
|
|
||||||
stdout, err := cmd.CombinedOutput()
|
|
||||||
if err != nil {
|
|
||||||
return res, err
|
|
||||||
}
|
|
||||||
|
|
||||||
var objmap []parseList
|
|
||||||
|
|
||||||
err = json.Unmarshal(stdout, &objmap)
|
|
||||||
if err != nil {
|
|
||||||
return res, err
|
|
||||||
}
|
|
||||||
|
|
||||||
for _, ele := range objmap {
|
|
||||||
res = append(res, ele.Name)
|
|
||||||
}
|
|
||||||
|
|
||||||
return res, err
|
|
||||||
}
|
|
||||||
|
|
||||||
// helm repo remove [NAME]
|
|
||||||
func (this HelmCommand) RemoveRepository(repo HelmRepo) (string, error) {
|
|
||||||
helm_bin := this.Bin
|
|
||||||
|
|
||||||
msg := fmt.Sprintf("%s repo remove %s", helm_bin, repo.Name)
|
|
||||||
log.Log().Debug().Msg(msg)
|
|
||||||
|
|
||||||
cmd_args := strings.Split(msg, " ")
|
|
||||||
|
|
||||||
cmd := this.Exec(cmd_args[0], cmd_args[1:]...)
|
|
||||||
stdout, err := cmd.CombinedOutput()
|
|
||||||
|
|
||||||
res := string(stdout)
|
|
||||||
res = strings.TrimSuffix(res, "\n")
|
|
||||||
|
|
||||||
return res, err
|
|
||||||
}
|
|
||||||
@@ -1,72 +0,0 @@
|
|||||||
package helm
|
|
||||||
|
|
||||||
import (
|
|
||||||
"testing"
|
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
|
||||||
)
|
|
||||||
|
|
||||||
func TestHelmListRepository(t *testing.T){
|
|
||||||
|
|
||||||
cmd := getCmdHelm(true, `[{"name":"bitnami","url":"https://charts.bitnami.com/bitnami"}]`)
|
|
||||||
|
|
||||||
res, err := cmd.ListRepository()
|
|
||||||
|
|
||||||
assert.Nilf(t, err, "error message %s", err)
|
|
||||||
assert.Equal(t, "bitnami", res[0], "TestHelmVersion error")
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestHelmRemoveRepository(t *testing.T){
|
|
||||||
|
|
||||||
cmd := getCmdHelm(true, `"bitnami" has been removed from your repositories`)
|
|
||||||
|
|
||||||
repo := HelmRepo{Name: "bitnami"}
|
|
||||||
res, err := cmd.RemoveRepository(repo)
|
|
||||||
|
|
||||||
assert.Nilf(t, err, "error message %s", err)
|
|
||||||
assert.Equal(t, `"bitnami" has been removed from your repositories`, res, "TestHelmRemoveRepository error")
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestHelmRemoveRepository2(t *testing.T){
|
|
||||||
|
|
||||||
cmd := getCmdHelm(true, `Error: no repositories configured`)
|
|
||||||
|
|
||||||
repo := HelmRepo{Name: "bitnami"}
|
|
||||||
res, err := cmd.RemoveRepository(repo)
|
|
||||||
|
|
||||||
assert.Nilf(t, err, "error message %s", err)
|
|
||||||
assert.Equal(t, `Error: no repositories configured`, res, "TestHelmRemoveRepository error")
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestHelmAddRepositoryNew(t *testing.T){
|
|
||||||
|
|
||||||
cmd_output := map[string]string{
|
|
||||||
"repo list -o json": `[{"name":"repo1","url":"https://repo.com"}]`,
|
|
||||||
"repo add repo2 https://repo2.com --force-update=false": `"repo2" has been added to your repositories"`,
|
|
||||||
}
|
|
||||||
|
|
||||||
cmd := getCmdsHelm(true, cmd_output)
|
|
||||||
|
|
||||||
repo := HelmRepo{Name: "repo2", Repository: "https://repo2.com", ForceUpdate: false}
|
|
||||||
res, err := cmd.AddRepository(repo)
|
|
||||||
|
|
||||||
assert.Nilf(t, err, "error message %s", err)
|
|
||||||
assert.Equal(t, `"repo2" has been added to your repositories"`, res, "TestHelmAddRepositoryNew error")
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
func TestHelmAddRepositoryExists(t *testing.T){
|
|
||||||
|
|
||||||
cmd_output := map[string]string{
|
|
||||||
"repo list -o json": `[{"name":"repo1","url":"https://repo.com"}]`,
|
|
||||||
"version --short": "v3.15.4+gfa9efb0",
|
|
||||||
}
|
|
||||||
|
|
||||||
cmd := getCmdsHelm(true, cmd_output)
|
|
||||||
|
|
||||||
repo := HelmRepo{Name: "repo1", Repository: "https://repo.com", ForceUpdate: false}
|
|
||||||
res, err := cmd.AddRepository(repo)
|
|
||||||
|
|
||||||
assert.Nilf(t, err, "error message %s", err)
|
|
||||||
assert.Equal(t, `Existe déjà`, res, "TestHelmRemoveRepository error")
|
|
||||||
}
|
|
||||||
@@ -1,70 +0,0 @@
|
|||||||
package helm
|
|
||||||
|
|
||||||
import (
|
|
||||||
// "fmt"
|
|
||||||
"encoding/json"
|
|
||||||
)
|
|
||||||
////
|
|
||||||
|
|
||||||
type parseStatusInfoResourcesMetadata struct {
|
|
||||||
Name string `json:"name"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// type parseStatusInfoResourcesPod struct {
|
|
||||||
// Api string `json:"apiVersion"`
|
|
||||||
// }
|
|
||||||
|
|
||||||
type parseStatusInfoResourcesStatefulSet struct {
|
|
||||||
Api string `json:"apiVersion"`
|
|
||||||
Kind string `json:"kind"`
|
|
||||||
Metadata parseStatusInfoResourcesMetadata `json:"metadata"`
|
|
||||||
}
|
|
||||||
|
|
||||||
type parseStatusInfoResourcesDeployment struct {
|
|
||||||
Api string `json:"apiVersion"`
|
|
||||||
Kind string `json:"kind"`
|
|
||||||
Metadata parseStatusInfoResourcesMetadata `json:"metadata"`
|
|
||||||
}
|
|
||||||
|
|
||||||
type parseStatusInfoResources struct {
|
|
||||||
// Pod []parseStatusInfoResourcesPod `json:"v1/Pod(related)"`
|
|
||||||
StatefulSet []parseStatusInfoResourcesStatefulSet `json:"v1/StatefulSet"`
|
|
||||||
Deployment []parseStatusInfoResourcesDeployment `json:"v1/Deployment"`
|
|
||||||
}
|
|
||||||
|
|
||||||
type parseStatusInfo struct {
|
|
||||||
Status string `json:"status"`
|
|
||||||
Resources parseStatusInfoResources `json:"Resources"`
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
type parseStatus struct {
|
|
||||||
Name string `json:"name"`
|
|
||||||
Info parseStatusInfo `json:"info"`
|
|
||||||
}
|
|
||||||
|
|
||||||
func (this HelmCommand) GetRessources(data HelmChart) (map[string]string, error) {
|
|
||||||
|
|
||||||
res := make(map[string]string)
|
|
||||||
|
|
||||||
status, err := this.Status(data)
|
|
||||||
if err != nil {
|
|
||||||
return res, err
|
|
||||||
}
|
|
||||||
|
|
||||||
var objmap parseStatus
|
|
||||||
|
|
||||||
err = json.Unmarshal([]byte(status), &objmap)
|
|
||||||
if err != nil {
|
|
||||||
return res, err
|
|
||||||
}
|
|
||||||
|
|
||||||
for _, ele := range objmap.Info.Resources.StatefulSet {
|
|
||||||
res[ele.Metadata.Name] = ele.Kind
|
|
||||||
}
|
|
||||||
for _, ele := range objmap.Info.Resources.Deployment {
|
|
||||||
res[ele.Metadata.Name] = ele.Kind
|
|
||||||
}
|
|
||||||
|
|
||||||
return res, nil
|
|
||||||
}
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
package helm
|
|
||||||
|
|
||||||
import (
|
|
||||||
"os"
|
|
||||||
"path/filepath"
|
|
||||||
|
|
||||||
"testing"
|
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
|
||||||
)
|
|
||||||
|
|
||||||
func TestHelmRessources(t *testing.T){
|
|
||||||
|
|
||||||
fileName := filepath.Join(TEST_SRC_DIR, "helm_status.json")
|
|
||||||
res_json, _ := os.ReadFile(fileName)
|
|
||||||
|
|
||||||
cmd := getCmdHelm(true, string(res_json))
|
|
||||||
|
|
||||||
data := HelmChart{Name: "test1"}
|
|
||||||
res, err := cmd.GetRessources(data)
|
|
||||||
|
|
||||||
assert.Nilf(t, err, "error message %s", err)
|
|
||||||
assert.Equal(t, "StatefulSet", res["oc-catalog-oc-catalog"], "TestHelmStatus error")
|
|
||||||
}
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
package helm
|
|
||||||
|
|
||||||
import (
|
|
||||||
"fmt"
|
|
||||||
"strings"
|
|
||||||
"errors"
|
|
||||||
|
|
||||||
log "oc-deploy/log_wrapper"
|
|
||||||
)
|
|
||||||
|
|
||||||
func (this HelmCommand) Status(data HelmChart) (string, error) {
|
|
||||||
|
|
||||||
helm_bin := this.Bin
|
|
||||||
|
|
||||||
msg := fmt.Sprintf("%s status %s --show-resources -o json", helm_bin, data.Name)
|
|
||||||
log.Log().Debug().Msg(msg)
|
|
||||||
|
|
||||||
cmd_args := strings.Split(msg, " ")
|
|
||||||
|
|
||||||
cmd := this.Exec(cmd_args[0], cmd_args[1:]...)
|
|
||||||
stdout, err := cmd.CombinedOutput()
|
|
||||||
if err != nil {
|
|
||||||
log.Log().Debug().Msg(string(stdout))
|
|
||||||
return "", errors.New(string(stdout))
|
|
||||||
}
|
|
||||||
|
|
||||||
return string(stdout), nil
|
|
||||||
}
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user