From fafe7b778270f6bd05bd42dd276a1c73141e0ea5 Mon Sep 17 00:00:00 2001 From: danielscholl Date: Thu, 3 Oct 2024 12:53:09 -0500 Subject: [PATCH] Enable Experimental Capabilities (#214) --- README.md | 10 +++++++- bicep/main.bicep | 11 +++++++-- bicep/main.parameters.json | 7 +++++- bicep/modules/blade_service.bicep | 25 ++++++++++++++++++-- charts/osdu-admin-ui/templates/_helpers.tpl | 11 +-------- charts/osdu-admin-ui/templates/code.yaml | 2 +- charts/osdu-admin-ui/templates/job.yaml | 2 +- charts/osdu-admin-ui/templates/storage.yaml | 2 +- charts/osdu-admin-ui/templates/web-site.yaml | 2 +- docs/src/architecture.md | 10 ++++---- docs/src/feature_flags.md | 9 +++++++ 11 files changed, 67 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index da980d87..841ea60b 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,6 @@ For detailed instructions, view our online [Documentation](https://azure.github. Supported services of OSDU are based on the release branch of OSDU as specified in the [OSDU Milestones](https://community.opengroup.org/osdu/platform/-/milestones). (ie: release/0.25 release/0.26, release/0.27, master etc.) - | **Core Services** | **Description** | |-------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------| | [Partition Service](https://community.opengroup.org/osdu/platform/system/partition) | Manages data partitions to ensure efficient data management and scalability. | @@ -40,6 +39,15 @@ Supported services of OSDU are based on the release branch of OSDU as specified | [Manifest Ingestion DAG](https://community.opengroup.org/osdu/platform/data-flow/ingestion/ingestion-dags) | Used for ingesting single or multiple metadata artifacts about datasets into OSDU. | | [CSV Parser DAG:](https://community.opengroup.org/osdu/platform/data-flow/ingestion/csv-parser/csv-parser) | Helps in parsing CSV files into a format for ingestion and processing. | +## Experimental Software + +OSDU offers different experimental capabilities that are very new or community contributions. These services are not yet fully mature but are available for early adopters to test and provide feedback. This solution supports the concepts of experimental software with opt in feature flags. + +| **Experimental Services** | **Description** | +|-------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------| +| [Admin UI](https://community.opengroup.org/osdu/ui/admin-ui-group/admin-ui-totalenergies/admin-ui-totalenergies) | A community supported Angular Administration UI for OSDU. | + + ## Getting Started > **IMPORTANT:** In order to deploy and run this example, you'll need an **Azure subscription** with [these namespaces](https://azure.github.io/osdu-developer/before_you_start/) registered. diff --git a/bicep/main.bicep b/bicep/main.bicep index 6803ae30..5412fa50 100644 --- a/bicep/main.bicep +++ b/bicep/main.bicep @@ -76,13 +76,18 @@ param clusterSoftware object = { enable: true osduCore: true osduReference: true - adminUI: true osduVersion: '' repository: '' branch: '' tag: '' } +@description('(Optional) Experimental Software Override - {enable/adminUI} --> true/false') +param experimentalSoftware object = { + enable: true + adminUI: true +} + // This would be a type but bugs exist for ARM Templates so is object instead. @description('Cluster Network Overrides - {ingress} (Both/Internal/External), {serviceCidr}, {dnsServiceIP}') param clusterNetwork object = { @@ -403,7 +408,9 @@ module serviceBlade 'modules/blade_service.bicep' = { enableSoftwareLoad: clusterSoftware.enable == 'false' ? false : true enableOsduCore: clusterSoftware.osduCore == 'false' ? false : true enableOsdureference: clusterSoftware.osduReference == 'false' ? false : true - enableAdminUI: clusterSoftware.adminUI == 'false' ? false : true + + enableExperimental: experimentalSoftware.enable == 'true' ? true : false + enableAdminUI: experimentalSoftware.adminUI == 'true' ? true : false emailAddress: emailAddress applicationClientId: applicationClientId diff --git a/bicep/main.parameters.json b/bicep/main.parameters.json index 9bcf7f6e..39902517 100644 --- a/bicep/main.parameters.json +++ b/bicep/main.parameters.json @@ -62,11 +62,16 @@ "osduVersion": "${SOFTWARE_VERSION}", "osduCore": "${ENABLE_OSDU_CORE}", "osduReference": "${ENABLE_OSDU_REFERENCE}", - "adminUI": "${ENABLE_ADMIN_UI}", "repository": "${SOFTWARE_REPOSITORY}", "branch": "${SOFTWARE_BRANCH}", "tag": "${SOFTWARE_TAG}" } + }, + "experimentalSoftware": { + "value": { + "enable": "${ENABLE_EXPERIMENTAL}", + "adminUI": "${ENABLE_ADMIN_UI}" + } } } } \ No newline at end of file diff --git a/bicep/modules/blade_service.bicep b/bicep/modules/blade_service.bicep index 5c853dfa..ffab1679 100644 --- a/bicep/modules/blade_service.bicep +++ b/bicep/modules/blade_service.bicep @@ -83,6 +83,9 @@ param clusterIngress string = 'External' @description('Feature Flag to Load Software.') param enableSoftwareLoad bool = true +@description('Feature Flag to Load Experimental Software.') +param enableExperimental bool = true + @description('Feature Flag to Load OSDU Core.') param enableOsduCore bool = true @@ -733,7 +736,7 @@ module fluxConfiguration 'br/public:avm/res/kubernetes-configuration/flux-config tag: serviceLayerConfig.gitops.tag } } - kustomizations: { + kustomizations: enableExperimental ? { components: { path: serviceLayerConfig.gitops.components timeoutInSeconds: 300 @@ -761,7 +764,25 @@ module fluxConfiguration 'br/public:avm/res/kubernetes-configuration/flux-config retryIntervalInSeconds: 300 prune: true } - } + } : { + components: { + path: serviceLayerConfig.gitops.components + timeoutInSeconds: 300 + syncIntervalInSeconds: 300 + retryIntervalInSeconds: 300 + prune: true + } + applications: { + path: serviceLayerConfig.gitops.applications + dependsOn: [ + 'components' + ] + timeoutInSeconds: 300 + syncIntervalInSeconds: 300 + retryIntervalInSeconds: 300 + prune: true + } + } } dependsOn: [ app_config diff --git a/charts/osdu-admin-ui/templates/_helpers.tpl b/charts/osdu-admin-ui/templates/_helpers.tpl index 13eaa1ca..83e4ed45 100644 --- a/charts/osdu-admin-ui/templates/_helpers.tpl +++ b/charts/osdu-admin-ui/templates/_helpers.tpl @@ -51,14 +51,5 @@ app.kubernetes.io/name: {{ include "osdu-admin-ui.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} {{- end }} -{{/* -Determine if the installation is enabled -*/}} -{{- define "osdu-admin-ui.isEnabled" -}} -{{- if .Values.enabled }} -{{- true -}} -{{- else -}} -{{- false -}} -{{- end -}} -{{- end }} + diff --git a/charts/osdu-admin-ui/templates/code.yaml b/charts/osdu-admin-ui/templates/code.yaml index adf326a2..9dbb5a51 100644 --- a/charts/osdu-admin-ui/templates/code.yaml +++ b/charts/osdu-admin-ui/templates/code.yaml @@ -1,4 +1,4 @@ -{{- if (include "osdu-admin-ui.isEnabled" .) }} +{{- if ne (.Values.adminUIEnabled | toString | lower) "false" }} --- apiVersion: v1 kind: ConfigMap diff --git a/charts/osdu-admin-ui/templates/job.yaml b/charts/osdu-admin-ui/templates/job.yaml index 92b14b7d..385d7f87 100644 --- a/charts/osdu-admin-ui/templates/job.yaml +++ b/charts/osdu-admin-ui/templates/job.yaml @@ -1,4 +1,4 @@ -{{- if (include "osdu-admin-ui.isEnabled" .) }} +{{- if ne (.Values.adminUIEnabled | toString | lower) "false" }} --- apiVersion: batch/v1 kind: Job diff --git a/charts/osdu-admin-ui/templates/storage.yaml b/charts/osdu-admin-ui/templates/storage.yaml index 7f224399..0e5d5548 100644 --- a/charts/osdu-admin-ui/templates/storage.yaml +++ b/charts/osdu-admin-ui/templates/storage.yaml @@ -1,4 +1,4 @@ -{{- if (include "osdu-admin-ui.isEnabled" .) }} +{{- if ne (.Values.adminUIEnabled | toString | lower) "false" }} --- apiVersion: v1 kind: PersistentVolumeClaim diff --git a/charts/osdu-admin-ui/templates/web-site.yaml b/charts/osdu-admin-ui/templates/web-site.yaml index d3b3e32e..e28a0ace 100644 --- a/charts/osdu-admin-ui/templates/web-site.yaml +++ b/charts/osdu-admin-ui/templates/web-site.yaml @@ -1,4 +1,4 @@ -{{- if (include "osdu-admin-ui.isEnabled" .) }} +{{- if ne (.Values.adminUIEnabled | toString | lower) "false" }} --- apiVersion: v1 kind: ConfigMap diff --git a/docs/src/architecture.md b/docs/src/architecture.md index 7e7f731f..bf627993 100644 --- a/docs/src/architecture.md +++ b/docs/src/architecture.md @@ -7,17 +7,19 @@ This provides valuable insights into best practices and design considerations of azure workloads. -#### Desired State Configuration +#### IaC: Declarative Resource Definition -Bicep is a domain-specific language (DSL) for deploying Azure resources declaratively. It simplifies authoring ARM templates and allows you to define the desired state of your Infrastructure as Code (IaC). Azure Resource Manager (ARM) processes the Bicep file to ensure the Azure environment matches the defined desired state, correcting any drift through redeployment. +Infrastructure as Code (IaC) uses declarative definitions to specify the desired state of cloud resources. Bicep is a domain-specific language (DSL) used for deploying Azure resources declaratively. It simplifies authoring ARM templates and allows you to define the desired state of your Infrastructure as Code (IaC). Azure Resource Manager (ARM) processes the Bicep file to ensure the Azure environment matches the defined desired state, correcting any drift through redeployment. !!! Note Microsoft recommends when developing with Bicep to use official [Azure Verified Modules](https://azure.github.io/Azure-Verified-Modules/). -#### Desired State Management +#### GitOps: Declarative Configuration Management -[GitOps](https://opengitops.dev) uses Git as a single source of truth for declarative components and applications. It ensures that the actual state of the components or application matches the desired state defined in the Git repository, automating updates through continuous monitoring and Git commits. +[GitOps](https://opengitops.dev) a term introduced by [WeaveWorks](https://www.weave.works/blog/the-history-of-gitops_) uses declarative configurations like Kustomize configs, Helm charts to manage software. Instead of scripting everything manually, GitOps uses a set of declarative configuration files that define a software desired state. + +GitOps uses versioned CI/CD on top of a declarative infrastructure, allowing developers to "[stop scripting and start shipping](https://twitter.com/kelseyhightower/status/953638870888849408)," as Kelsey Hightower put it. This declarative configuration is helpful to define the entire softwarestack as code and continuously deliver changes with confidence to environments. ## Command Sequence diff --git a/docs/src/feature_flags.md b/docs/src/feature_flags.md index 15a4f56a..6749427a 100644 --- a/docs/src/feature_flags.md +++ b/docs/src/feature_flags.md @@ -38,6 +38,15 @@ Software customizations can be managed and modified using the following feature | SOFTWARE_BRANCH | Customizes the branch used for software definition | +## Experimental Software + +Experimental Software can be managed and modified using the following feature flags. + +| Feature Flag | Description | +|---------------------------|-----------------------------------------------------------------------------| +| ENABLE_EXPERIMENTAL | Enables loading of experimental software (False by default) | +| ENABLE_ADMIN_UI | Enables loading of the Admin UI (False by default) | + ## Storage Access Control public access to Storage.