diff --git a/README.md b/README.md index e99fb6d..15db043 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ docker compose up -d The API specification is available in the folder `openapi`. For a more interactive visualisation of the API, the `docker-compose` also spins up a swagger ui instance. -Visit this [page](http://localhost) to explore the endpoints, DTOs and run example queries. +Visit this [http://localhost](http://localhost) to explore the endpoints, DTOs and run example queries. ### Local build and run @@ -601,45 +601,24 @@ These models are specified under the folder `trusted_library`. The models are written in the [LCA as CODE](https://lca-as-code.com) language. This is a domain-specific language designed for the need of lifecycle analysis. -The models under the folder `trusted_library` are directly loaded in the server +The models under the folder `trusted_library/lib` are directly loaded in the server to perform the assessments. A [tutorial](https://lca-as-code.com/book) is available if you want to learn more about the language itself. The source repository is available [here](https://github.com/kleis-technology/lcaac). The folder `trusted_library` is organized as follows. - -* `01-hardware` : this folder contains the PCR models for the functional units 1 to 4. -* `02-pooling` : this folder contains the PCR models for the functional units 5 to 7. -* `03-services` : this folder contains higher functional units. +* `lib` : this folder contains the models written in [LCA as CODE](https://lca-as-code.com). +* `inventory` : this folder contains inventory data (csv files) Here is an illustration of this layering structure. sankey -#### Configuring the models - -You can read and edit the models in `trusted_library` with any text editor. -Unless you need to customize one of the functional units, there is no need to actually modify the models. - -The folder `trusted_library/data` contains inventory files (in CSV format), -and associated emission factors. To adapt Cloud Assess you must fill in, at least, -the following inventories - -* `data/01-hardware/dc_inventory.csv` : this file lists the available datacenters. -* `data/01-hardware/server_inventory.csv` : this file lists the available servers. -* `data/01-hardware/network_inventory.csv` : this file lists the available network equipments. -* `data/01-hardware/storage_inventory.csv` : this file lists the available storage equipments. - -The following files should be filled with the relevant emission factors: - -* `data/01-hardware/dc_impacts.csv` -* `data/01-hardware/server_impacts.csv` -* `data/01-hardware/network_impacts.csv` -* `data/01-hardware/storage_impacts.csv` -* `data/01-hardware/electricity_mix.csv` +#### Configuring and deploying Cloud Assess -Note that the emission factors presented in this repository are mock values. +Check out the [wiki](https://github.com/kleis-technology/cloud-assess/wiki/Deploying-Cloud-Assess) +for a tutorial on how to configure and deploy Cloud Assess in a Kubernetes environment. ## License diff --git a/RELEASE.md b/RELEASE.md new file mode 100644 index 0000000..ab81ef6 --- /dev/null +++ b/RELEASE.md @@ -0,0 +1,7 @@ +# Release + +Before releasing a new version, check that the Cloud Assess version +is correctly set in +- `build.gradle.kts` +- `docker-compose.yaml` +- `charts/cloud-assess/Chart.yaml` diff --git a/build.gradle.kts b/build.gradle.kts index 66a59d9..3a747df 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -11,7 +11,7 @@ plugins { } group = "org.cloud_assess" -version = "2.0.1" +version = "2.1.0" java { sourceCompatibility = JavaVersion.VERSION_17 @@ -52,6 +52,8 @@ dependencies { implementation("com.charleskorn.kaml:kaml:0.59.0") implementation("org.springframework.boot:spring-boot-starter-actuator") + + implementation("org.apache.commons:commons-compress:1.28.0") } tasks.withType { diff --git a/charts/cloud-assess/.helmignore b/charts/cloud-assess/.helmignore new file mode 100644 index 0000000..0e8a0eb --- /dev/null +++ b/charts/cloud-assess/.helmignore @@ -0,0 +1,23 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/charts/cloud-assess/Chart.yaml b/charts/cloud-assess/Chart.yaml new file mode 100644 index 0000000..b4a34d9 --- /dev/null +++ b/charts/cloud-assess/Chart.yaml @@ -0,0 +1,24 @@ +apiVersion: v2 +name: cloud-assess +description: A Helm chart for Kubernetes + +# A chart can be either an 'application' or a 'library' chart. +# +# Application charts are a collection of templates that can be packaged into versioned archives +# to be deployed. +# +# Library charts provide useful utilities or functions for the chart developer. They're included as +# a dependency of application charts to inject those utilities and functions into the rendering +# pipeline. Library charts do not define any templates and therefore cannot be deployed. +type: application + +# This is the chart version. This version number should be incremented each time you make changes +# to the chart and its templates, including the app version. +# Versions are expected to follow Semantic Versioning (https://semver.org/) +version: 0.1.0 + +# This is the version number of the application being deployed. This version number should be +# incremented each time you make changes to the application. Versions are not expected to +# follow Semantic Versioning. They should reflect the version the application is using. +# It is recommended to use it with quotes. +appVersion: "v2.1.0" diff --git a/charts/cloud-assess/templates/NOTES.txt b/charts/cloud-assess/templates/NOTES.txt new file mode 100644 index 0000000..be2ec14 --- /dev/null +++ b/charts/cloud-assess/templates/NOTES.txt @@ -0,0 +1,35 @@ +1. Get the application URL by running these commands: +{{- if .Values.httpRoute.enabled }} +{{- if .Values.httpRoute.hostnames }} + export APP_HOSTNAME={{ .Values.httpRoute.hostnames | first }} +{{- else }} + export APP_HOSTNAME=$(kubectl get --namespace {{(first .Values.httpRoute.parentRefs).namespace | default .Release.Namespace }} gateway/{{ (first .Values.httpRoute.parentRefs).name }} -o jsonpath="{.spec.listeners[0].hostname}") + {{- end }} +{{- if and .Values.httpRoute.rules (first .Values.httpRoute.rules).matches (first (first .Values.httpRoute.rules).matches).path.value }} + echo "Visit http://$APP_HOSTNAME{{ (first (first .Values.httpRoute.rules).matches).path.value }} to use your application" + + NOTE: Your HTTPRoute depends on the listener configuration of your gateway and your HTTPRoute rules. + The rules can be set for path, method, header and query parameters. + You can check the gateway configuration with 'kubectl get --namespace {{(first .Values.httpRoute.parentRefs).namespace | default .Release.Namespace }} gateway/{{ (first .Values.httpRoute.parentRefs).name }} -o yaml' +{{- end }} +{{- else if .Values.ingress.enabled }} +{{- range $host := .Values.ingress.hosts }} + {{- range .paths }} + http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }} + {{- end }} +{{- end }} +{{- else if contains "NodePort" .Values.service.type }} + export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "cloud-assess.fullname" . }}) + export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") + echo http://$NODE_IP:$NODE_PORT +{{- else if contains "LoadBalancer" .Values.service.type }} + NOTE: It may take a few minutes for the LoadBalancer IP to be available. + You can watch its status by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "cloud-assess.fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "cloud-assess.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") + echo http://$SERVICE_IP:{{ .Values.service.port }} +{{- else if contains "ClusterIP" .Values.service.type }} + export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "cloud-assess.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") + echo "Visit http://127.0.0.1:8080 to use your application" + kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT +{{- end }} diff --git a/charts/cloud-assess/templates/_helpers.tpl b/charts/cloud-assess/templates/_helpers.tpl new file mode 100644 index 0000000..20477ed --- /dev/null +++ b/charts/cloud-assess/templates/_helpers.tpl @@ -0,0 +1,62 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "cloud-assess.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "cloud-assess.fullname" -}} +{{- if .Values.fullnameOverride }} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- $name := default .Chart.Name .Values.nameOverride }} +{{- if contains $name .Release.Name }} +{{- .Release.Name | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} +{{- end }} +{{- end }} +{{- end }} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "cloud-assess.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "cloud-assess.labels" -}} +helm.sh/chart: {{ include "cloud-assess.chart" . }} +{{ include "cloud-assess.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "cloud-assess.selectorLabels" -}} +app.kubernetes.io/name: {{ include "cloud-assess.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "cloud-assess.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "cloud-assess.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/charts/cloud-assess/templates/deployment.yaml b/charts/cloud-assess/templates/deployment.yaml new file mode 100644 index 0000000..809abdf --- /dev/null +++ b/charts/cloud-assess/templates/deployment.yaml @@ -0,0 +1,89 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "cloud-assess.fullname" . }} + labels: + {{- include "cloud-assess.labels" . | nindent 4 }} +spec: + {{- if not .Values.autoscaling.enabled }} + replicas: {{ .Values.replicaCount }} + {{- end }} + selector: + matchLabels: + {{- include "cloud-assess.selectorLabels" . | nindent 6 }} + template: + metadata: + annotations: + checksum/inventory.zip: {{ .Values.lca.archive.inventory.content | sha256sum }} + {{- with .Values.podAnnotations }} + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "cloud-assess.labels" . | nindent 8 }} + {{- with .Values.podLabels }} + {{- toYaml . | nindent 8 }} + {{- end }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "cloud-assess.serviceAccountName" . }} + {{- with .Values.podSecurityContext }} + securityContext: + {{- toYaml . | nindent 8 }} + {{- end }} + containers: + - name: {{ .Chart.Name }} + {{- with .Values.securityContext }} + securityContext: + {{- toYaml . | nindent 12 }} + {{- end }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + env: + - name: LCA_DIRECTORY + value: {{ .Values.lca.directory }} + - name: LCA_LIB_DIRECTORY + value: {{ .Values.lca.lib.directory }} + - name: LCA_ARCHIVE_DIRECTORY + value: {{ .Values.lca.archive.directory }} + - name: LCA_INVENTORY_ZIP + value: {{ .Values.lca.archive.inventory.filename }} + - name: LCA_INVENTORY_DIRECTORY + value: {{ .Values.lca.inventory.directory }} + ports: + - name: http + containerPort: {{ .Values.service.port }} + protocol: TCP + {{- with .Values.livenessProbe }} + livenessProbe: + {{- toYaml . | nindent 12 }} + {{- end }} + {{- with .Values.readinessProbe }} + readinessProbe: + {{- toYaml . | nindent 12 }} + {{- end }} + {{- with .Values.resources }} + resources: + {{- toYaml . | nindent 12 }} + {{- end }} + volumeMounts: + - name: archive + mountPath: {{ .Values.lca.directory }}/{{ .Values.lca.archive.directory }} + volumes: + - name: archive + configMap: + name: {{ .Values.lca.archive.configMapName }} + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/charts/cloud-assess/templates/hpa.yaml b/charts/cloud-assess/templates/hpa.yaml new file mode 100644 index 0000000..3acbe25 --- /dev/null +++ b/charts/cloud-assess/templates/hpa.yaml @@ -0,0 +1,32 @@ +{{- if .Values.autoscaling.enabled }} +apiVersion: autoscaling/v2 +kind: HorizontalPodAutoscaler +metadata: + name: {{ include "cloud-assess.fullname" . }} + labels: + {{- include "cloud-assess.labels" . | nindent 4 }} +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ include "cloud-assess.fullname" . }} + minReplicas: {{ .Values.autoscaling.minReplicas }} + maxReplicas: {{ .Values.autoscaling.maxReplicas }} + metrics: + {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} + - type: Resource + resource: + name: cpu + target: + type: Utilization + averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} + {{- end }} + {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} + - type: Resource + resource: + name: memory + target: + type: Utilization + averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} + {{- end }} +{{- end }} diff --git a/charts/cloud-assess/templates/httproute.yaml b/charts/cloud-assess/templates/httproute.yaml new file mode 100644 index 0000000..520c006 --- /dev/null +++ b/charts/cloud-assess/templates/httproute.yaml @@ -0,0 +1,38 @@ +{{- if .Values.httpRoute.enabled -}} +{{- $fullName := include "cloud-assess.fullname" . -}} +{{- $svcPort := .Values.service.port -}} +apiVersion: gateway.networking.k8s.io/v1 +kind: HTTPRoute +metadata: + name: {{ $fullName }} + labels: + {{- include "cloud-assess.labels" . | nindent 4 }} + {{- with .Values.httpRoute.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + parentRefs: + {{- with .Values.httpRoute.parentRefs }} + {{- toYaml . | nindent 4 }} + {{- end }} + {{- with .Values.httpRoute.hostnames }} + hostnames: + {{- toYaml . | nindent 4 }} + {{- end }} + rules: + {{- range .Values.httpRoute.rules }} + {{- with .matches }} + - matches: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .filters }} + filters: + {{- toYaml . | nindent 8 }} + {{- end }} + backendRefs: + - name: {{ $fullName }} + port: {{ $svcPort }} + weight: 1 + {{- end }} +{{- end }} diff --git a/charts/cloud-assess/templates/ingress.yaml b/charts/cloud-assess/templates/ingress.yaml new file mode 100644 index 0000000..ea4775a --- /dev/null +++ b/charts/cloud-assess/templates/ingress.yaml @@ -0,0 +1,43 @@ +{{- if .Values.ingress.enabled -}} +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: {{ include "cloud-assess.fullname" . }} + labels: + {{- include "cloud-assess.labels" . | nindent 4 }} + {{- with .Values.ingress.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + {{- with .Values.ingress.className }} + ingressClassName: {{ . }} + {{- end }} + {{- if .Values.ingress.tls }} + tls: + {{- range .Values.ingress.tls }} + - hosts: + {{- range .hosts }} + - {{ . | quote }} + {{- end }} + secretName: {{ .secretName }} + {{- end }} + {{- end }} + rules: + {{- range .Values.ingress.hosts }} + - host: {{ .host | quote }} + http: + paths: + {{- range .paths }} + - path: {{ .path }} + {{- with .pathType }} + pathType: {{ . }} + {{- end }} + backend: + service: + name: {{ include "cloud-assess.fullname" $ }} + port: + number: {{ $.Values.service.port }} + {{- end }} + {{- end }} +{{- end }} diff --git a/charts/cloud-assess/templates/inventory.yaml b/charts/cloud-assess/templates/inventory.yaml new file mode 100644 index 0000000..401f125 --- /dev/null +++ b/charts/cloud-assess/templates/inventory.yaml @@ -0,0 +1,6 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ .Values.lca.archive.configMapName }} +binaryData: + {{ .Values.lca.archive.inventory.filename }}: {{ .Values.lca.archive.inventory.content | quote }} diff --git a/charts/cloud-assess/templates/service.yaml b/charts/cloud-assess/templates/service.yaml new file mode 100644 index 0000000..9bb0a96 --- /dev/null +++ b/charts/cloud-assess/templates/service.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "cloud-assess.fullname" . }} + labels: + {{- include "cloud-assess.labels" . | nindent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: http + protocol: TCP + name: http + selector: + {{- include "cloud-assess.selectorLabels" . | nindent 4 }} diff --git a/charts/cloud-assess/templates/serviceaccount.yaml b/charts/cloud-assess/templates/serviceaccount.yaml new file mode 100644 index 0000000..f19646d --- /dev/null +++ b/charts/cloud-assess/templates/serviceaccount.yaml @@ -0,0 +1,13 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "cloud-assess.serviceAccountName" . }} + labels: + {{- include "cloud-assess.labels" . | nindent 4 }} + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +automountServiceAccountToken: {{ .Values.serviceAccount.automount }} +{{- end }} diff --git a/charts/cloud-assess/templates/tests/test-connection.yaml b/charts/cloud-assess/templates/tests/test-connection.yaml new file mode 100644 index 0000000..b0a120f --- /dev/null +++ b/charts/cloud-assess/templates/tests/test-connection.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Pod +metadata: + name: "{{ include "cloud-assess.fullname" . }}-test-connection" + labels: + {{- include "cloud-assess.labels" . | nindent 4 }} + annotations: + "helm.sh/hook": test +spec: + containers: + - name: wget + image: busybox + command: ['wget'] + args: ['{{ include "cloud-assess.fullname" . }}:{{ .Values.service.port }}'] + restartPolicy: Never diff --git a/charts/cloud-assess/values.yaml b/charts/cloud-assess/values.yaml new file mode 100644 index 0000000..ba81268 --- /dev/null +++ b/charts/cloud-assess/values.yaml @@ -0,0 +1,290 @@ +# Default values for cloud-assess. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +# This will set the replicaset count more information can be found here: https://kubernetes.io/docs/concepts/workloads/controllers/replicaset/ +replicaCount: 1 + +# This sets the container image more information can be found here: https://kubernetes.io/docs/concepts/containers/images/ +image: + repository: ghcr.io/kleis-technology/cloud-assess/cloud-assess-app + # This sets the pull policy for images. + pullPolicy: IfNotPresent + # Overrides the image tag whose default is the chart appVersion. +# tag: + +# This is for the secrets for pulling an image from a private repository more information can be found here: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ +imagePullSecrets: [] +# This is to override the chart name. +nameOverride: "" +fullnameOverride: "" + +# This section builds out the service account more information can be found here: https://kubernetes.io/docs/concepts/security/service-accounts/ +serviceAccount: + # Specifies whether a service account should be created + create: false + # Automatically mount a ServiceAccount's API credentials? + automount: true + # Annotations to add to the service account + annotations: {} + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "" + +# This is for setting Kubernetes Annotations to a Pod. +# For more information checkout: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +podAnnotations: {} +# This is for setting Kubernetes Labels to a Pod. +# For more information checkout: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +podLabels: {} + +podSecurityContext: {} + # fsGroup: 2000 + +securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + +# This is for setting up a service more information can be found here: https://kubernetes.io/docs/concepts/services-networking/service/ +service: + # This sets the service type more information can be found here: https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types + type: ClusterIP + # This sets the ports more information can be found here: https://kubernetes.io/docs/concepts/services-networking/service/#field-spec-ports + port: 8080 + +# This block is for setting up the ingress for more information can be found here: https://kubernetes.io/docs/concepts/services-networking/ingress/ +ingress: + enabled: false + className: "" + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + hosts: + - host: chart-example.local + paths: + - path: / + pathType: ImplementationSpecific + tls: [] + # - secretName: chart-example-tls + # hosts: + # - chart-example.local + +# -- Expose the service via gateway-api HTTPRoute +# Requires Gateway API resources and suitable controller installed within the cluster +# (see: https://gateway-api.sigs.k8s.io/guides/) +httpRoute: + # HTTPRoute enabled. + enabled: false + # HTTPRoute annotations. + annotations: {} + # Which Gateways this Route is attached to. + parentRefs: + - name: gateway + sectionName: http + # namespace: default + # Hostnames matching HTTP header. + hostnames: + - chart-example.local + # List of rules and filters applied. + rules: + - matches: + - path: + type: PathPrefix + value: /headers + # filters: + # - type: RequestHeaderModifier + # requestHeaderModifier: + # set: + # - name: My-Overwrite-Header + # value: this-is-the-only-value + # remove: + # - User-Agent + # - matches: + # - path: + # type: PathPrefix + # value: /echo + # headers: + # - name: version + # value: v2 + +resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + +# This is to setup the liveness and readiness probes more information can be found here: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/ +livenessProbe: + httpGet: + path: /actuator/health + port: 8080 +readinessProbe: + httpGet: + path: /actuator/health + port: 8080 + +# This section is for setting up autoscaling more information can be found here: https://kubernetes.io/docs/concepts/workloads/autoscaling/ +autoscaling: + enabled: false + minReplicas: 1 + maxReplicas: 100 + targetCPUUtilizationPercentage: 80 + # targetMemoryUtilizationPercentage: 80 + +nodeSelector: {} + +tolerations: [] + +affinity: {} + +lca: + directory: trusted_library # working directory + lib: + directory: lib + inventory: + directory: inventory + archive: + directory: archive + configMapName: archive + inventory: + filename: inventory.zip + content: | + UEsDBBQAAAAIAKVSg1r+qaln2QMAAAFDAAATABwAc3RvcmFnZV9pbXBhY3RzLmNzdlVUCQAD9UTu + Z0QaCWl1eAsAAQT1AQAABBQAAADtml1rWzkQhu/3t8hiPjSj0WVpw7LQUrM09DJkE7sNJE5IbBb2 + 1+8rN4Ztvbc96oWSHMf4KNLMM6N3hhx9/fvq7jbd31y97DdP6c279aa/bNObdXr76XLTX75e3Xz7 + tbtJF09bXA+49un3z+t+bfvL/SH98Wd6f5k+vlun9Ye0/vh2nT5fpk/ri377r99e9o8r4vRwvTts + r2/2h+e73ZdEmagRk5IlrU6aG1XjoCjeEtdMpiFVrbhZE09FSFs211KLuIYmzVwd78WKNiKqF6ua + OAe5igX+vnHg3sXKjqvV8KhakmQSDcbqahL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MUAAAACAClUoNa + k94ZrUoBAAC2AwAAFwAYAAAAAAABAAAApIHCCAAAbWFpbnRlbmFuY2VfaW1wYWN0cy5jc3ZVVAUA + A/VE7md1eAsAAQT1AQAABBQAAABQSwECHgMUAAAACAClUoNaityPGVgAAACCAAAAEAAYAAAAAAAB + AAAApIFdCgAAdm1faW52ZW50b3J5LmNzdlVUBQAD9UTuZ3V4CwABBPUBAAAEFAAAAFBLAQIeAxQA + AAAIAKVSg1qlvPRc2QMAAAFDAAASABgAAAAAAAEAAACkgf8KAABzZXJ2ZXJfaW1wYWN0cy5jc3ZV + VAUAA/VE7md1eAsAAQT1AQAABBQAAABQSwECHgMUAAAACAClUoNa/sUP3dgDAAABQwAAEwAYAAAA + AAABAAAApIEkDwAAbmV0d29ya19pbXBhY3RzLmNzdlVUBQAD9UTuZ3V4CwABBPUBAAAEFAAAAFBL + AQIeAxQAAAAIAKVSg1oNCHy50wEAAMgDAAAOABgAAAAAAAEAAACkgUkTAABkY19pbXBhY3RzLmNz + dlVUBQAD9UTuZ3V4CwABBPUBAAAEFAAAAFBLAQIeAxQAAAAIAKVSg1oqLXJjvgAAACQBAAATABgA + AAAAAAEAAACkgWQVAABlbGVjdHJpY2l0eV9taXguY3N2VVQFAAP1RO5ndXgLAAEE9QEAAAQUAAAA + UEsBAh4DFAAAAAgApVKDWltsZK0fAQAATAUAABUAGAAAAAAAAQAAAKSBbxYAAHN0b3JhZ2VfaW52 + ZW50b3J5LmNzdlVUBQAD9UTuZ3V4CwABBPUBAAAEFAAAAFBLBQYAAAAADQANAIwEAADdFwAAAAA= + diff --git a/docker-compose.yaml b/docker-compose.yaml index bbcd9b3..80a4e3b 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,13 +1,16 @@ services: app: - image: "ghcr.io/kleis-technology/cloud-assess/cloud-assess-app:v2.0.1" + image: "ghcr.io/kleis-technology/cloud-assess/cloud-assess-app:v2.1.0" container_name: cloud-assess-app ports: - "8080:8080" volumes: - - ./trusted_library:/config + - ./trusted_library:/trusted_library environment: - - LCA_CONFIG=/config + - LCA_DIRECTORY=/trusted_library + - LCA_LIB_DIRECTORY=lib + - LCA_ARCHIVE_DIRECTORY=archive + - LCA_INVENTORY_DIRECTORY=inventory # - CORS_ENABLED=true # - CORS_ALLOWED_ORIGIN=http://localhost swagger_ui: diff --git a/flake.lock b/flake.lock index 3b20463..7f7d21c 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,23 @@ { "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, "lcaac-flake": { "inputs": { "nixpkgs": "nixpkgs" @@ -33,21 +51,41 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 0, - "narHash": "sha256-v2NB8B3EahTvJ0Zg6QVJVUjq2cBwZ0UKTwMr2nv9718=", - "path": "/nix/store/hpyq11kyx19ggxi78ryhhhc9ai9p7jxp-source", - "type": "path" + "lastModified": 1761999846, + "narHash": "sha256-IYlYnp4O4dzEpL77BD/lj5NnJy2J8qbHkNSFiPBCbqo=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "3de8f8d73e35724bf9abef41f1bdbedda1e14a31", + "type": "github" }, "original": { - "id": "nixpkgs", - "type": "indirect" + "owner": "nixos", + "ref": "nixos-25.05", + "repo": "nixpkgs", + "type": "github" } }, "root": { "inputs": { + "flake-utils": "flake-utils", "lcaac-flake": "lcaac-flake", "nixpkgs": "nixpkgs_2" } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 5b86959..15553ec 100644 --- a/flake.nix +++ b/flake.nix @@ -1,25 +1,27 @@ { description = "Cloud Assess flake"; - inputs.lcaac-flake = { - url = "github:kleis-technology/homebrew-lcaac/v2.0.0"; + inputs = { + lcaac-flake.url = "github:kleis-technology/homebrew-lcaac/v2.0.0"; + nixpkgs.url = "github:nixos/nixpkgs/nixos-25.05"; + flake-utils.url = "github:numtide/flake-utils"; }; - outputs = inputs@{ nixpkgs, lcaac-flake, ...}: - { - devShells = { - aarch64-darwin.default = + outputs = inputs@{ nixpkgs, lcaac-flake, flake-utils, ...}: + flake-utils.lib.eachDefaultSystem ( + system: let - pkgs = nixpkgs.legacyPackages.aarch64-darwin; + pkgs = nixpkgs.legacyPackages.${system}; in - pkgs.mkShell { - name = "cloud-assess-dev-shell"; - packages = with pkgs; [ - jdk23 - gradle - python312 - python312Packages.uv - lcaac-flake.packages.aarch64-darwin.lcaac-cli - ]; - }; - }; - }; + { + devShells.default = pkgs.mkShell { + name = "cloud-assess-dev-shell"; + packages = with pkgs; [ + jdk17 + gradle + python312 + python312Packages.uv + lcaac-flake.packages.aarch64-darwin.lcaac-cli + ]; + }; + } + ); } diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 033e24c..1b33c55 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 62f495d..ca025c8 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew index fcb6fca..23d15a9 100755 --- a/gradlew +++ b/gradlew @@ -15,6 +15,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# SPDX-License-Identifier: Apache-2.0 +# ############################################################################## # @@ -55,7 +57,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -83,7 +85,8 @@ done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -111,7 +114,7 @@ case "$( uname )" in #( NONSTOP* ) nonstop=true ;; esac -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar +CLASSPATH="\\\"\\\"" # Determine the Java command to use to start the JVM. @@ -144,7 +147,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac @@ -152,7 +155,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then '' | soft) :;; #( *) # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -201,16 +204,16 @@ fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ + -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \ "$@" # Stop when "xargs" is not available. diff --git a/gradlew.bat b/gradlew.bat index 93e3f59..db3a6ac 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -13,6 +13,8 @@ @rem See the License for the specific language governing permissions and @rem limitations under the License. @rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem @if "%DEBUG%"=="" @echo off @rem ########################################################################## @@ -43,11 +45,11 @@ set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -57,22 +59,22 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail :execute @rem Setup the command line -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar +set CLASSPATH= @rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* :end @rem End local scope for the variables with windows NT shell diff --git a/src/main/kotlin/org/cloud_assess/Application.kt b/src/main/kotlin/org/cloud_assess/Application.kt index c8b04d7..31406a8 100644 --- a/src/main/kotlin/org/cloud_assess/Application.kt +++ b/src/main/kotlin/org/cloud_assess/Application.kt @@ -1,10 +1,39 @@ package org.cloud_assess +import org.apache.commons.compress.archivers.examples.Expander +import org.slf4j.LoggerFactory +import org.springframework.beans.factory.annotation.Value +import org.springframework.boot.CommandLineRunner import org.springframework.boot.autoconfigure.SpringBootApplication import org.springframework.boot.runApplication +import java.nio.file.Path +import kotlin.io.path.div +import kotlin.io.path.isRegularFile @SpringBootApplication -class CloudAssessApplication +class CloudAssessApplication( + @param:Value("\${lca.directory}") private val workingDir: Path, + @param:Value("\${lca.inventory.directory}") private val inventorySubdir: Path, + @param:Value("\${lca.archive.directory}") private val archiveSubdir: Path, + @param:Value("\${lca.inventory.zip:#{null}}") private val inventoryZipFile: Path?, +) : CommandLineRunner { + private val logger = LoggerFactory.getLogger(javaClass) + + override fun run(vararg args: String?) { + inventoryZipFile + ?.let { workingDir / archiveSubdir / it } + ?.let { + if (it.isRegularFile()) it else { + logger.info("File ${it.toAbsolutePath()} is not a regular file") + null + } + } + ?.let { + logger.info("Extracting `$it` to ${workingDir / inventorySubdir}") + Expander().expand(it, workingDir / inventorySubdir) + } + } +} fun main(args: Array) { runApplication(*args) diff --git a/src/main/kotlin/org/cloud_assess/config/LcaConfig.kt b/src/main/kotlin/org/cloud_assess/config/LcaConfig.kt index 753cec8..f876e8a 100644 --- a/src/main/kotlin/org/cloud_assess/config/LcaConfig.kt +++ b/src/main/kotlin/org/cloud_assess/config/LcaConfig.kt @@ -1,10 +1,13 @@ package org.cloud_assess.config +import ch.kleis.lcaac.core.config.CacheConfig +import ch.kleis.lcaac.core.config.ConnectorConfig import ch.kleis.lcaac.core.config.LcaacConfig import ch.kleis.lcaac.core.datasource.ConnectorFactory import ch.kleis.lcaac.core.datasource.DataSourceConnector import ch.kleis.lcaac.core.datasource.DefaultDataSourceOperations import ch.kleis.lcaac.core.datasource.cache.SourceOpsCache +import ch.kleis.lcaac.core.datasource.csv.CsvConnectorKeys import ch.kleis.lcaac.core.lang.SymbolTable import ch.kleis.lcaac.core.math.basic.BasicNumber import ch.kleis.lcaac.core.math.basic.BasicOperations @@ -12,9 +15,6 @@ import ch.kleis.lcaac.grammar.Loader import ch.kleis.lcaac.grammar.LoaderOption import ch.kleis.lcaac.grammar.parser.LcaLangLexer import ch.kleis.lcaac.grammar.parser.LcaLangParser -import com.charleskorn.kaml.Yaml -import com.charleskorn.kaml.YamlConfiguration -import com.charleskorn.kaml.decodeFromStream import org.antlr.v4.runtime.CharStreams import org.antlr.v4.runtime.CommonTokenStream import org.springframework.beans.factory.annotation.Value @@ -23,15 +23,18 @@ import org.springframework.context.annotation.Configuration import java.io.File import java.nio.file.Files import java.nio.file.Path +import kotlin.io.path.div import kotlin.io.path.isRegularFile @Configuration class LcaConfig { @Bean fun symbolTable( - @Value("\${lca.config}") modelDirectory: Path, + @Value("\${lca.directory}") workingDir: Path, + @Value("\${lca.lib.directory}") libSubdir: Path, ): SymbolTable { - val files = Files.walk(modelDirectory) + val libDir = workingDir / libSubdir + val files = Files.walk(libDir) .filter { it.isRegularFile() && it.fileName.toString().endsWith(".lca") } @@ -50,37 +53,36 @@ class LcaConfig { @Bean fun lcaacConfig( - @Value("\${lca.config}") modelDirectory: Path, - @Value("\${lca.manifest}") manifest: String + @Value("\${lca.directory}") workingDir: Path, + @Value("\${lca.inventory.directory}") inventorySubdir: Path, ): LcaacConfig { - val configFile = Files.walk(modelDirectory, 1) - .filter { - it.isRegularFile() && - (it.fileName.toString() == manifest.trim()) - } - .findFirst() - .orElseThrow { throw IllegalStateException("cannot find 'lcaac.yaml' nor 'lcaac.yml' in $modelDirectory") } - .toFile() - val yaml = Yaml( - configuration = YamlConfiguration( - strictMode = false - ) + val config = LcaacConfig( + name = "Cloud Assess", + description = "Cloud Assess default LCAAC configuration", + connectors = listOf( + ConnectorConfig( + name = CsvConnectorKeys.CSV_CONNECTOR_NAME, + cache = CacheConfig( + enabled = false, + maxSize = 1024, + ), + options = mapOf( + CsvConnectorKeys.CSV_CONNECTOR_KEY_DIRECTORY to inventorySubdir.toString(), + ) + ) + ), ) - val yamlConfig = if (configFile.exists()) configFile.inputStream().use { - yaml.decodeFromStream(LcaacConfig.serializer(), it) - } - else LcaacConfig() - return yamlConfig + return config } @Bean fun connectorFactory( lcaacConfig: LcaacConfig, - @Value("\${lca.config}") modelDirectory: File, + @Value("\${lca.directory}") workingDir: File, symbolTable: SymbolTable, ): ConnectorFactory { return ConnectorFactory( - workingDirectory = modelDirectory.path, + workingDirectory = workingDir.path, lcaacConfig = lcaacConfig, ops = BasicOperations, symbolTable = symbolTable, diff --git a/src/main/kotlin/org/cloud_assess/service/debug/TraceService.kt b/src/main/kotlin/org/cloud_assess/service/debug/TraceService.kt index 0d635c5..69e6d91 100644 --- a/src/main/kotlin/org/cloud_assess/service/debug/TraceService.kt +++ b/src/main/kotlin/org/cloud_assess/service/debug/TraceService.kt @@ -80,7 +80,7 @@ class TraceService( val symbolTableWithGlobalData = symbolTable.copy(data = globals(symbolTable.data, request)) val newSymbolTable = request.datasources ?.fold(symbolTableWithGlobalData) - {acc, next -> symbolTable.overrideDatasourceConnector(DataSourceKey(next.name), IN_MEMORY_CONNECTOR_NAME)} + {_, next -> symbolTable.overrideDatasourceConnector(DataSourceKey(next.name), IN_MEMORY_CONNECTOR_NAME)} ?: symbolTableWithGlobalData val evaluator = Evaluator(newSymbolTable, BasicOperations, sourceOps) diff --git a/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/src/main/resources/META-INF/additional-spring-configuration-metadata.json index f43632e..febea6e 100644 --- a/src/main/resources/META-INF/additional-spring-configuration-metadata.json +++ b/src/main/resources/META-INF/additional-spring-configuration-metadata.json @@ -1,16 +1,33 @@ { "properties": [ { - "name": "lca.config", + "name": "lca.directory", "type": "java.lang.String", - "description": "Path to LCA as CODE config directory.", - "defaultValue": "trusted_library" + "description": "Working directory." }, { - "name": "lca.manifest", + "name": "lca.lib.directory", "type": "java.lang.String", - "description": "Name of the manifest in the config directory.", - "defaultValue": "lcaac.yaml" + "description": "Library directory relatively to working directory.", + "defaultValue": "lib" + }, + { + "name": "lca.archive.directory", + "type": "java.lang.String", + "description": "Archive directory relatively to working directory.", + "defaultValue": "lib" + }, + { + "name": "lca.inventory.directory", + "type": "java.lang.String", + "description": "Inventory directory relatively to working directory.", + "defaultValue": "inventory" + }, + { + "name": "lca.inventory.zip", + "type": "java.lang.String", + "description": "Inventory zip relatively to archive directory.", + "defaultValue": null }, { "name": "cors.allowed-origin", @@ -24,23 +41,5 @@ "description": "Enable CORS.", "defaultValue": false }, - { - "name": "compute.job-size", - "type": "java.lang.Integer", - "description": "Job size.", - "defaultValue": 100 - }, - { - "name": "resilio-db.url", - "type": "java.lang.String", - "description": "Resilio DB URL.", - "defaultValue": "https://db.resilio.tech" - }, - { - "name": "resilio-db.access-token", - "type": "java.lang.String", - "description": "Resilio DB access token.", - "defaultValue": null - } ] } diff --git a/src/main/resources/application.yaml b/src/main/resources/application.yaml index f08f400..2892f28 100644 --- a/src/main/resources/application.yaml +++ b/src/main/resources/application.yaml @@ -1,6 +1,12 @@ lca: - config: trusted_library - manifest: lcaac.yaml + directory: trusted_library + lib: + directory: lib + archive: + directory: archive + inventory: + directory: inventory +# zip: inventory.zip cors: enabled: false allowed-origin: diff --git a/src/test/resources/application.yaml b/src/test/resources/application.yaml index 7d571a2..2892f28 100644 --- a/src/test/resources/application.yaml +++ b/src/test/resources/application.yaml @@ -1,8 +1,12 @@ lca: - config: trusted_library - manifest: lcaac.yaml + directory: trusted_library + lib: + directory: lib + archive: + directory: archive + inventory: + directory: inventory +# zip: inventory.zip cors: enabled: false allowed-origin: -compute: - job-size: 100 diff --git a/trusted_library/data/01-hardware/network_inventory.csv b/trusted_library/data/01-hardware/network_inventory.csv deleted file mode 100644 index a30fdb3..0000000 --- a/trusted_library/data/01-hardware/network_inventory.csv +++ /dev/null @@ -1,19 +0,0 @@ -id,pool_id,dc_id,power,lifespan,format,number_of_ports,cpu_quantity,cpu_model_name,cpu_core_number,ram_quantity,ram_unit_size,fan_quantity,quantity,comment -net-01,client_vm,dc-generic-glo,300,5,,,,,,,,,1, -net-02,client_vm,dc-generic-glo,200,5,,,,,,,,,1, -net-03,client_vm,dc-generic-glo,100,5,,,,,,,,,1, -net-11,client_compute,dc-generic-glo,300,5,,,,,,,,,1, -net-12,client_compute,dc-generic-glo,200,5,,,,,,,,,1, -net-13,client_compute,dc-generic-glo,100,5,,,,,,,,,1, -net-21,client_database,dc-generic-glo,300,5,,,,,,,,,1, -net-22,client_database,dc-generic-glo,200,5,,,,,,,,,1, -net-23,client_database,dc-generic-glo,100,5,,,,,,,,,1, -net-31,client_storage_space,dc-generic-glo,300,5,,,,,,,,,1, -net-32,client_storage_space,dc-generic-glo,200,5,,,,,,,,,1, -net-33,client_storage_space,dc-generic-glo,100,5,,,,,,,,,1, -net-41,client_paas,dc-generic-glo,300,5,,,,,,,,,1, -net-42,client_paas,dc-generic-glo,200,5,,,,,,,,,1, -net-43,client_paas,dc-generic-glo,100,5,,,,,,,,,1, -mutualized-net-01,mutualized,dc-generic-glo,600,5,,,,,,,,,1, -mutualized-net-02,mutualized,dc-generic-glo,300,5,,,,,,,,,1, -mutualized-net-03,mutualized,dc-generic-glo,200,5,,,,,,,,,1, diff --git a/trusted_library/data/01-hardware/server_inventory.csv b/trusted_library/data/01-hardware/server_inventory.csv deleted file mode 100644 index e0b2da9..0000000 --- a/trusted_library/data/01-hardware/server_inventory.csv +++ /dev/null @@ -1,19 +0,0 @@ -id,pool_id,dc_id,power,lifespan,hdd_quantity,hdd_unit_size,ssd_quantity,ssd_unit_size,ram_quantity,ram_unit_size,gpu_quantity,gpu_model_name,fan_quantity,psu_total_weight,load_rate,comment,quantity -srv-01,client_vm,dc-generic-glo,100,5,,,,,,,,,,,,,1 -srv-02,client_vm,dc-generic-glo,150,5,,,,,,,,,,,,,1 -srv-03,client_vm,dc-generic-glo,200,5,,,,,,,,,,,,,1 -srv-11,client_compute,dc-generic-glo,100,5,,,,,,,,,,,,,1 -srv-12,client_compute,dc-generic-glo,150,5,,,,,,,,,,,,,1 -srv-13,client_compute,dc-generic-glo,200,5,,,,,,,,,,,,,1 -srv-21,client_database,dc-generic-glo,100,5,,,,,,,,,,,,,1 -srv-22,client_database,dc-generic-glo,150,5,,,,,,,,,,,,,1 -srv-23,client_database,dc-generic-glo,200,5,,,,,,,,,,,,,1 -srv-31,client_storage_space,dc-generic-glo,100,5,,,,,,,,,,,,,1 -srv-32,client_storage_space,dc-generic-glo,150,5,,,,,,,,,,,,,1 -srv-33,client_storage_space,dc-generic-glo,200,5,,,,,,,,,,,,,1 -srv-41,client_paas,dc-generic-glo,100,5,,,,,,,,,,,,,1 -srv-42,client_paas,dc-generic-glo,150,5,,,,,,,,,,,,,1 -srv-43,client_paas,dc-generic-glo,200,5,,,,,,,,,,,,,1 -mutualized-srv-01,mutualized,dc-generic-glo,300,5,,,,,,,,,,,,,1 -mutualized-srv-02,mutualized,dc-generic-glo,500,5,,,,,,,,,,,,,1 -mutualized-srv-03,mutualized,dc-generic-glo,100,5,,,,,,,,,,,,,1 diff --git a/trusted_library/data/01-hardware/storage_inventory.csv b/trusted_library/data/01-hardware/storage_inventory.csv deleted file mode 100644 index 3e7221e..0000000 --- a/trusted_library/data/01-hardware/storage_inventory.csv +++ /dev/null @@ -1,19 +0,0 @@ -id,pool_id,dc_id,power,lifespan,format,cpu_quantity,cpu_model_name,cpu_core_number,hdd_quantity,hdd_unit_size,ssd_quantity,ssd_unit_size,ram_quantity,ram_unit_size,gpu_quantity,gpu_model_name,fan_quantity,psu_total_weight,comment,quantity -sto-01,client_vm,dc-generic-glo,100,5,,,,,,,,,,,,,,,,1 -sto-02,client_vm,dc-generic-glo,200,5,,,,,,,,,,,,,,,,1 -sto-03,client_vm,dc-generic-glo,400,5,,,,,,,,,,,,,,,,1 -sto-11,client_compute,dc-generic-glo,100,5,,,,,,,,,,,,,,,,1 -sto-12,client_compute,dc-generic-glo,200,5,,,,,,,,,,,,,,,,1 -sto-13,client_compute,dc-generic-glo,400,5,,,,,,,,,,,,,,,,1 -sto-21,client_database,dc-generic-glo,100,5,,,,,,,,,,,,,,,,1 -sto-22,client_database,dc-generic-glo,200,5,,,,,,,,,,,,,,,,1 -sto-23,client_database,dc-generic-glo,400,5,,,,,,,,,,,,,,,,1 -sto-31,client_storage_space,dc-generic-glo,100,5,,,,,,,,,,,,,,,,1 -sto-32,client_storage_space,dc-generic-glo,200,5,,,,,,,,,,,,,,,,1 -sto-33,client_storage_space,dc-generic-glo,400,5,,,,,,,,,,,,,,,,1 -sto-41,client_paas,dc-generic-glo,100,5,,,,,,,,,,,,,,,,1 -sto-42,client_paas,dc-generic-glo,200,5,,,,,,,,,,,,,,,,1 -sto-43,client_paas,dc-generic-glo,400,5,,,,,,,,,,,,,,,,1 -mutualized-sto-01,mutualized,dc-generic-glo,100,5,,,,,,,,,,,,,,,,1 -mutualized-sto-02,mutualized,dc-generic-glo,200,5,,,,,,,,,,,,,,,,1 -mutualized-sto-03,mutualized,dc-generic-glo,300,5,,,,,,,,,,,,,,,,1 diff --git a/trusted_library/data/02-pooling/compute_inventory.csv b/trusted_library/inventory/compute_inventory.csv similarity index 100% rename from trusted_library/data/02-pooling/compute_inventory.csv rename to trusted_library/inventory/compute_inventory.csv diff --git a/trusted_library/data/01-hardware/dc_impacts.csv b/trusted_library/inventory/dc_impacts.csv similarity index 100% rename from trusted_library/data/01-hardware/dc_impacts.csv rename to trusted_library/inventory/dc_impacts.csv diff --git a/trusted_library/data/01-hardware/dc_inventory.csv b/trusted_library/inventory/dc_inventory.csv similarity index 100% rename from trusted_library/data/01-hardware/dc_inventory.csv rename to trusted_library/inventory/dc_inventory.csv diff --git a/trusted_library/data/01-hardware/electricity_mix.csv b/trusted_library/inventory/electricity_mix.csv similarity index 100% rename from trusted_library/data/01-hardware/electricity_mix.csv rename to trusted_library/inventory/electricity_mix.csv diff --git a/trusted_library/data/01-hardware/maintenance_impacts.csv b/trusted_library/inventory/maintenance_impacts.csv similarity index 100% rename from trusted_library/data/01-hardware/maintenance_impacts.csv rename to trusted_library/inventory/maintenance_impacts.csv diff --git a/trusted_library/data/01-hardware/network_impacts.csv b/trusted_library/inventory/network_impacts.csv similarity index 100% rename from trusted_library/data/01-hardware/network_impacts.csv rename to trusted_library/inventory/network_impacts.csv diff --git a/trusted_library/inventory/network_inventory.csv b/trusted_library/inventory/network_inventory.csv new file mode 100644 index 0000000..6de057e --- /dev/null +++ b/trusted_library/inventory/network_inventory.csv @@ -0,0 +1,19 @@ +id,pool_id,dc_id,power,lifespan,quantity +net-01,client_vm,dc-generic-glo,300,5,1 +net-02,client_vm,dc-generic-glo,200,5,1 +net-03,client_vm,dc-generic-glo,100,5,1 +net-11,client_compute,dc-generic-glo,300,5,1 +net-12,client_compute,dc-generic-glo,200,5,1 +net-13,client_compute,dc-generic-glo,100,5,1 +net-21,client_database,dc-generic-glo,300,5,1 +net-22,client_database,dc-generic-glo,200,5,1 +net-23,client_database,dc-generic-glo,100,5,1 +net-31,client_storage_space,dc-generic-glo,300,5,1 +net-32,client_storage_space,dc-generic-glo,200,5,1 +net-33,client_storage_space,dc-generic-glo,100,5,1 +net-41,client_paas,dc-generic-glo,300,5,1 +net-42,client_paas,dc-generic-glo,200,5,1 +net-43,client_paas,dc-generic-glo,100,5,1 +mutualized-net-01,mutualized,dc-generic-glo,600,5,1 +mutualized-net-02,mutualized,dc-generic-glo,300,5,1 +mutualized-net-03,mutualized,dc-generic-glo,200,5,1 diff --git a/trusted_library/data/01-hardware/server_impacts.csv b/trusted_library/inventory/server_impacts.csv similarity index 100% rename from trusted_library/data/01-hardware/server_impacts.csv rename to trusted_library/inventory/server_impacts.csv diff --git a/trusted_library/inventory/server_inventory.csv b/trusted_library/inventory/server_inventory.csv new file mode 100644 index 0000000..4665067 --- /dev/null +++ b/trusted_library/inventory/server_inventory.csv @@ -0,0 +1,19 @@ +id,pool_id,dc_id,power,lifespan,quantity +srv-01,client_vm,dc-generic-glo,100,5,1 +srv-02,client_vm,dc-generic-glo,150,5,1 +srv-03,client_vm,dc-generic-glo,200,5,1 +srv-11,client_compute,dc-generic-glo,100,5,1 +srv-12,client_compute,dc-generic-glo,150,5,1 +srv-13,client_compute,dc-generic-glo,200,5,1 +srv-21,client_database,dc-generic-glo,100,5,1 +srv-22,client_database,dc-generic-glo,150,5,1 +srv-23,client_database,dc-generic-glo,200,5,1 +srv-31,client_storage_space,dc-generic-glo,100,5,1 +srv-32,client_storage_space,dc-generic-glo,150,5,1 +srv-33,client_storage_space,dc-generic-glo,200,5,1 +srv-41,client_paas,dc-generic-glo,100,5,1 +srv-42,client_paas,dc-generic-glo,150,5,1 +srv-43,client_paas,dc-generic-glo,200,5,1 +mutualized-srv-01,mutualized,dc-generic-glo,300,5,1 +mutualized-srv-02,mutualized,dc-generic-glo,500,5,1 +mutualized-srv-03,mutualized,dc-generic-glo,100,5,1 diff --git a/trusted_library/data/01-hardware/storage_impacts.csv b/trusted_library/inventory/storage_impacts.csv similarity index 100% rename from trusted_library/data/01-hardware/storage_impacts.csv rename to trusted_library/inventory/storage_impacts.csv diff --git a/trusted_library/inventory/storage_inventory.csv b/trusted_library/inventory/storage_inventory.csv new file mode 100644 index 0000000..c0c6d8d --- /dev/null +++ b/trusted_library/inventory/storage_inventory.csv @@ -0,0 +1,19 @@ +id,pool_id,dc_id,power,lifespan,quantity +sto-01,client_vm,dc-generic-glo,100,5,1 +sto-02,client_vm,dc-generic-glo,200,5,1 +sto-03,client_vm,dc-generic-glo,400,5,1 +sto-11,client_compute,dc-generic-glo,100,5,1 +sto-12,client_compute,dc-generic-glo,200,5,1 +sto-13,client_compute,dc-generic-glo,400,5,1 +sto-21,client_database,dc-generic-glo,100,5,1 +sto-22,client_database,dc-generic-glo,200,5,1 +sto-23,client_database,dc-generic-glo,400,5,1 +sto-31,client_storage_space,dc-generic-glo,100,5,1 +sto-32,client_storage_space,dc-generic-glo,200,5,1 +sto-33,client_storage_space,dc-generic-glo,400,5,1 +sto-41,client_paas,dc-generic-glo,100,5,1 +sto-42,client_paas,dc-generic-glo,200,5,1 +sto-43,client_paas,dc-generic-glo,400,5,1 +mutualized-sto-01,mutualized,dc-generic-glo,100,5,1 +mutualized-sto-02,mutualized,dc-generic-glo,200,5,1 +mutualized-sto-03,mutualized,dc-generic-glo,300,5,1 diff --git a/trusted_library/data/02-pooling/storage_space_inventory.csv b/trusted_library/inventory/storage_space_inventory.csv similarity index 100% rename from trusted_library/data/02-pooling/storage_space_inventory.csv rename to trusted_library/inventory/storage_space_inventory.csv diff --git a/trusted_library/data/02-pooling/vm_inventory.csv b/trusted_library/inventory/vm_inventory.csv similarity index 100% rename from trusted_library/data/02-pooling/vm_inventory.csv rename to trusted_library/inventory/vm_inventory.csv diff --git a/trusted_library/lcaac.yaml b/trusted_library/lcaac.yaml index 49c1ec4..413285a 100644 --- a/trusted_library/lcaac.yaml +++ b/trusted_library/lcaac.yaml @@ -10,4 +10,4 @@ connectors: cache: enabled: true options: - directory: data + directory: inventory diff --git a/trusted_library/00-globals/globals.lca b/trusted_library/lib/00-globals/globals.lca similarity index 100% rename from trusted_library/00-globals/globals.lca rename to trusted_library/lib/00-globals/globals.lca diff --git a/trusted_library/00-globals/units.lca b/trusted_library/lib/00-globals/units.lca similarity index 100% rename from trusted_library/00-globals/units.lca rename to trusted_library/lib/00-globals/units.lca diff --git a/trusted_library/01-hardware/01-datacenter-mutualized/mutualized.lca b/trusted_library/lib/01-hardware/01-datacenter-mutualized/mutualized.lca similarity index 100% rename from trusted_library/01-hardware/01-datacenter-mutualized/mutualized.lca rename to trusted_library/lib/01-hardware/01-datacenter-mutualized/mutualized.lca diff --git a/trusted_library/01-hardware/01-datacenter-mutualized/network.lca b/trusted_library/lib/01-hardware/01-datacenter-mutualized/network.lca similarity index 100% rename from trusted_library/01-hardware/01-datacenter-mutualized/network.lca rename to trusted_library/lib/01-hardware/01-datacenter-mutualized/network.lca diff --git a/trusted_library/01-hardware/01-datacenter-mutualized/server.lca b/trusted_library/lib/01-hardware/01-datacenter-mutualized/server.lca similarity index 100% rename from trusted_library/01-hardware/01-datacenter-mutualized/server.lca rename to trusted_library/lib/01-hardware/01-datacenter-mutualized/server.lca diff --git a/trusted_library/01-hardware/01-datacenter-mutualized/storage.lca b/trusted_library/lib/01-hardware/01-datacenter-mutualized/storage.lca similarity index 100% rename from trusted_library/01-hardware/01-datacenter-mutualized/storage.lca rename to trusted_library/lib/01-hardware/01-datacenter-mutualized/storage.lca diff --git a/trusted_library/01-hardware/01-datacenter/datacenter.lca b/trusted_library/lib/01-hardware/01-datacenter/datacenter.lca similarity index 98% rename from trusted_library/01-hardware/01-datacenter/datacenter.lca rename to trusted_library/lib/01-hardware/01-datacenter/datacenter.lca index 9dc427e..df959dc 100644 --- a/trusted_library/01-hardware/01-datacenter/datacenter.lca +++ b/trusted_library/lib/01-hardware/01-datacenter/datacenter.lca @@ -1,5 +1,5 @@ datasource dc_inventory { - location = "01-hardware/dc_inventory.csv" + location = "dc_inventory.csv" schema { id = "dc-01" geo = "GLO" @@ -11,7 +11,7 @@ datasource dc_inventory { } datasource dc_impacts { - location = "01-hardware/dc_impacts.csv" + location = "dc_impacts.csv" schema { dc_id = "dc-01" lc_step = "manufacturing" diff --git a/trusted_library/01-hardware/01-datacenter/electricity.lca b/trusted_library/lib/01-hardware/01-datacenter/electricity.lca similarity index 97% rename from trusted_library/01-hardware/01-datacenter/electricity.lca rename to trusted_library/lib/01-hardware/01-datacenter/electricity.lca index 3367a33..909b0c8 100644 --- a/trusted_library/01-hardware/01-datacenter/electricity.lca +++ b/trusted_library/lib/01-hardware/01-datacenter/electricity.lca @@ -1,5 +1,5 @@ datasource electricity_mix { - location = "01-hardware/electricity_mix.csv" + location = "electricity_mix.csv" schema { geo = "GLO" diff --git a/trusted_library/01-hardware/02-server/server.lca b/trusted_library/lib/01-hardware/02-server/server.lca similarity index 100% rename from trusted_library/01-hardware/02-server/server.lca rename to trusted_library/lib/01-hardware/02-server/server.lca diff --git a/trusted_library/01-hardware/03-storage/storage.lca b/trusted_library/lib/01-hardware/03-storage/storage.lca similarity index 100% rename from trusted_library/01-hardware/03-storage/storage.lca rename to trusted_library/lib/01-hardware/03-storage/storage.lca diff --git a/trusted_library/01-hardware/04-network/network.lca b/trusted_library/lib/01-hardware/04-network/network.lca similarity index 100% rename from trusted_library/01-hardware/04-network/network.lca rename to trusted_library/lib/01-hardware/04-network/network.lca diff --git a/trusted_library/01-hardware/datasources.lca b/trusted_library/lib/01-hardware/datasources.lca similarity index 91% rename from trusted_library/01-hardware/datasources.lca rename to trusted_library/lib/01-hardware/datasources.lca index da69f22..eebe401 100644 --- a/trusted_library/01-hardware/datasources.lca +++ b/trusted_library/lib/01-hardware/datasources.lca @@ -1,5 +1,5 @@ datasource maintenance_impacts { - location = "01-hardware/maintenance_impacts.csv" + location = "maintenance_impacts.csv" schema { id = "maintenance" lc_step = "use" @@ -28,7 +28,7 @@ datasource maintenance_impacts { } datasource server_inventory { - location = "01-hardware/server_inventory.csv" + location = "server_inventory.csv" schema { id = "srv-01" dc_id = "dc-01" @@ -40,7 +40,7 @@ datasource server_inventory { } datasource server_impacts { - location = "01-hardware/server_impacts.csv" + location = "server_impacts.csv" schema { hw_id = "srv-01" lc_step = "manufacturing" @@ -74,7 +74,7 @@ datasource server_impacts { } datasource storage_inventory { - location = "01-hardware/storage_inventory.csv" + location = "storage_inventory.csv" schema { id = "srv-01" dc_id = "dc-01" @@ -86,7 +86,7 @@ datasource storage_inventory { } datasource storage_impacts { - location = "01-hardware/storage_impacts.csv" + location = "storage_impacts.csv" schema { hw_id = "srv-01" lc_step = "manufacturing" @@ -120,7 +120,7 @@ datasource storage_impacts { } datasource network_inventory { - location = "01-hardware/network_inventory.csv" + location = "network_inventory.csv" schema { id = "srv-01" dc_id = "dc-01" @@ -132,7 +132,7 @@ datasource network_inventory { } datasource network_impacts { - location = "01-hardware/network_impacts.csv" + location = "network_impacts.csv" schema { hw_id = "srv-01" lc_step = "manufacturing" diff --git a/trusted_library/01-hardware/maintenance.lca b/trusted_library/lib/01-hardware/maintenance.lca similarity index 100% rename from trusted_library/01-hardware/maintenance.lca rename to trusted_library/lib/01-hardware/maintenance.lca diff --git a/trusted_library/02-pooling/05-compute/compute.lca b/trusted_library/lib/02-pooling/05-compute/compute.lca similarity index 97% rename from trusted_library/02-pooling/05-compute/compute.lca rename to trusted_library/lib/02-pooling/05-compute/compute.lca index d4171fe..6f11154 100644 --- a/trusted_library/02-pooling/05-compute/compute.lca +++ b/trusted_library/lib/02-pooling/05-compute/compute.lca @@ -1,5 +1,5 @@ datasource compute_inventory { - location = "02-pooling/compute_inventory.csv" + location = "compute_inventory.csv" schema { id = "comp-01" // e.g., a client id pool_id = "client_compute" diff --git a/trusted_library/02-pooling/05-compute/compute_pool_equipment.lca b/trusted_library/lib/02-pooling/05-compute/compute_pool_equipment.lca similarity index 100% rename from trusted_library/02-pooling/05-compute/compute_pool_equipment.lca rename to trusted_library/lib/02-pooling/05-compute/compute_pool_equipment.lca diff --git a/trusted_library/02-pooling/06-virtual-machine/vm.lca b/trusted_library/lib/02-pooling/06-virtual-machine/vm.lca similarity index 98% rename from trusted_library/02-pooling/06-virtual-machine/vm.lca rename to trusted_library/lib/02-pooling/06-virtual-machine/vm.lca index 9556dc5..b6e725d 100644 --- a/trusted_library/02-pooling/06-virtual-machine/vm.lca +++ b/trusted_library/lib/02-pooling/06-virtual-machine/vm.lca @@ -1,5 +1,5 @@ datasource vm_inventory { - location = "02-pooling/vm_inventory.csv" + location = "vm_inventory.csv" schema { id = "vm-01" pool_id = "client_vm" diff --git a/trusted_library/02-pooling/06-virtual-machine/vm_pool_equipment.lca b/trusted_library/lib/02-pooling/06-virtual-machine/vm_pool_equipment.lca similarity index 100% rename from trusted_library/02-pooling/06-virtual-machine/vm_pool_equipment.lca rename to trusted_library/lib/02-pooling/06-virtual-machine/vm_pool_equipment.lca diff --git a/trusted_library/02-pooling/07-storage-space/space_pool_equipment.lca b/trusted_library/lib/02-pooling/07-storage-space/space_pool_equipment.lca similarity index 100% rename from trusted_library/02-pooling/07-storage-space/space_pool_equipment.lca rename to trusted_library/lib/02-pooling/07-storage-space/space_pool_equipment.lca diff --git a/trusted_library/02-pooling/07-storage-space/storage_space.lca b/trusted_library/lib/02-pooling/07-storage-space/storage_space.lca similarity index 98% rename from trusted_library/02-pooling/07-storage-space/storage_space.lca rename to trusted_library/lib/02-pooling/07-storage-space/storage_space.lca index 123d2b4..2533bed 100644 --- a/trusted_library/02-pooling/07-storage-space/storage_space.lca +++ b/trusted_library/lib/02-pooling/07-storage-space/storage_space.lca @@ -1,5 +1,5 @@ datasource storage_space_inventory { - location = "02-pooling/storage_space_inventory.csv" + location = "storage_space_inventory.csv" schema { id = "sto-sp-01" pool_id = "client_storage_space" diff --git a/trusted_library/02-pooling/pool.lca b/trusted_library/lib/02-pooling/pool.lca similarity index 100% rename from trusted_library/02-pooling/pool.lca rename to trusted_library/lib/02-pooling/pool.lca diff --git a/trusted_library/03-services/service.lca b/trusted_library/lib/03-services/service.lca similarity index 100% rename from trusted_library/03-services/service.lca rename to trusted_library/lib/03-services/service.lca