Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Software sequencing #181

Merged
merged 10 commits into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Auto - Documentation
name: Auto - Doc

on:
# Trigger spell check on pull requests
Expand Down
12 changes: 4 additions & 8 deletions bicep/modules/aks_cluster.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,6 @@ var outboundTrafficType = aksOutboundTrafficType=='natGateway' ? ( custom_vnet ?

@description('System Pool presets are derived from the recommended system pool specs')
var systemPoolPresets = {
// 4 vCPU, 16 GiB RAM, 32 GiB Temp Disk, (3600) IOPS, 128 GB Managed OS Disk
Burstable : {
vmSize: 'Standard_B2ms'
minCount: 1
Expand All @@ -350,7 +349,6 @@ var systemPoolPresets = {
osDiskSize: 128
maxPods: 30
}
// 2 vCPU, 7 GiB RAM, 14 GiB SSD, (8000) IOPS, 128 GB Managed OS Disk
Standard : {
vmSize: 'Standard_D2s_v5'
minCount: 1
Expand Down Expand Up @@ -393,10 +391,9 @@ var systemPoolProfile = {

@description('First User Pool presets')
var userPoolPresets = {
// 4 vCPU, 16 GiB RAM, 32 GiB Temp Disk, (3600) IOPS, 128 GB Managed OS Disk
Burstable : {
vmSize: 'Standard_B4ms'
minCount: 3
minCount: 4
maxCount: 20
availabilityZones: [
'1'
Expand All @@ -405,12 +402,11 @@ var userPoolPresets = {
]
osDiskType: 'Managed'
osDiskSize: 128
maxPods: 30
maxPods: 60
}
// 4 vCPU, 32 GiB RAM, 64 GiB SSD, (8000) IOPS, 128 GB Managed OS Disk
Standard : {
vmSize: 'Standard_D4s_v5'
minCount: 3
minCount: 4
maxCount: 20
availabilityZones: [
'1'
Expand All @@ -419,7 +415,7 @@ var userPoolPresets = {
]
osDiskType: 'Managed'
osDiskSize: 128
maxPods: 30
maxPods: 60
}
}

Expand Down
27 changes: 16 additions & 11 deletions docs/pipelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ A number of CI workflows are leveraged in this repo to test the bicep files to e

It's essential to catch as many problems before a single resource is deployed to real infrastructure. There are a lot of tools and techniques that can be leveraged to catch functional or syntactical problems.

![[1]][1]

#### PSRule for Azure

An interesting project for performing pre/post validation of Azure Resources against the [Well Architected Framework](https://learn.microsoft.com/en-us/azure/architecture/framework/) is [PSRule for Azure](https://azure.github.io/PSRule.Rules.Azure/). Over [200 rules](https://azure.github.io/PSRule.Rules.Azure/en/baselines/Azure.All/) will be evaluated against the Arm template, ranging from Security configuration to naming conventions.
Expand Down Expand Up @@ -42,25 +44,28 @@ The fact that a deployment completes successfully is a great sign, however there

In this case we are installing software and we are testing the software is installed.

## Solution actions used in this repo
## Github Actions

This section outlines the key GitHub Actions implemented in this repository to ensure code quality, automate builds, and streamline releases. These actions form the backbone of the continuous integration and deployment pipeline, enhancing our development workflow and maintaining high standards across our project.

### Infra - Test
![[0]][0]

#### Infra - Test

This action will run a Validate Step to ensure any changes to bicep is acceptable. It also will trigger a Standards Check that is non blocking in order to determine if the solution passes the PSRule checks.

### Infra - Build
#### Infra - Build

This action ensures that the bicep can build properly.

### Infra - Release
#### Infra - Release

The release action will run whenever a release is created to ensure we have a copy of the ARM template from that release that could then be used by other systems as necessary.

<!--- https://diagrams.helpful.dev/ --->
```mermaid
sequenceDiagram
participant Workflow as "GitHub Workflow"

participant Azure as "Azure/login@v2"
participant extension1 as "github-tag-action@1.69.0"
participant bashCommand as "bash"
Expand All @@ -69,7 +74,6 @@ sequenceDiagram
participant EndBug as "add-and-commit@v9"
participant extension3 as "release-action@v1"


Workflow->>Workflow: Manual Trigger
Workflow->>Workflow: Code Checkout
Workflow->>Azure: Azure Login
Expand All @@ -82,9 +86,7 @@ sequenceDiagram
Workflow->>extension3: Create Release
```

## Misc actions used in this repo

### Auto -Documentation Check
#### Auto - Doc

This action performs two main functions:

Expand All @@ -94,10 +96,13 @@ This action performs two main functions:

The action is triggered on pull requests that modify markdown files, pushes to the main branch that affect the docs/src directory, and can also be run manually from the Actions tab. This comprehensive approach helps maintain high-quality, current documentation for the project.

### Auto - Greet
#### Auto - Greet

This is an auto action for a bot to reply to open issues and open pull requests.

### Auto - Label
#### Auto - Label

This is an auto action for a bot to automatically apply labels based on detection of type of code change.

[0]: src/images/pipeline_1.png "Validation Diagram"
[1]: src/images/pipeline_2.png "Pipeline Diagram"
10 changes: 3 additions & 7 deletions docs/src/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,6 @@
This provides valuable insights into best practices and design
considerations of azure workloads.


**Cost Optimization** - Create a cost-effective solution while balancing security.

**Security** - Enhance security within a development context, adhering to a zero trust model.

**Operational Excellence** - Prioritize standards with automation to ensure efficient operations and robust monitoring.

#### Desired State Configuration

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.
Expand Down Expand Up @@ -103,4 +96,7 @@ A GitOps configuration resides in this Git repository and uses a customized [rep

A GitOps approach simplifies the process of deploying and managing software, making it easier to maintain and update, as well as providing a configurable way of leveraging other software configurations by pointing to alternate repositories hosting other configurations. By leveraging this method, we ensure that our deployments can be extended to things that not only include the default software load.

![[1]][1]

[0]: images/architecture.png "Architecture Diagram"
[1]: images/architecture_2.png "Gitops Diagram"
Binary file added docs/src/images/architecture_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/src/images/overview_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/src/images/overview_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/src/images/pipeline_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/src/images/pipeline_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ OSDU Developer is an open-source solution designed to enable the creation of lig

The primary goal for this solution is to provide an environment that can help function within an inner loop process providing faster feedback for developers. This personal environment strives to be user-friendly yet maintain compliance with varying organizational standards. It offers a flexible framework to facilitate deeper exploration of OSDU™ capabilities.

![[0]][0]

Deploying personal instances provide valuable insights into early-stage development and integration processes. It emphasizes transparency, cost-efficiency, and flexibility, empowering developers to engage in essential application and cloud development scenarios.

!!! Note
Expand Down Expand Up @@ -40,6 +42,8 @@ Several use cases illustrate the practical applications for this approach.

**Training and Onboarding:** Train new employees on the OSDU™ platform, offering hands-on experience in a controlled environment.

![[1]][1]


## Features

Expand All @@ -61,3 +65,5 @@ Several use cases illustrate the practical applications for this approach.

Follow the instructions in the "Tutorials" to quickly bring online a personal instance.

[0]: images/overview_1.png "Overview Diagram"
[1]: images/overview_2.png "Use Cases Diagram"
94 changes: 75 additions & 19 deletions docs/src/software.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,5 @@
# Software Management

In this solution, we utilize a **GitOps** approach for efficient and reliable software management. This method leverages a git repository as the source of truth for defining and updating the software within the cluster and comes with some distinct advantages.

- **Consistency and Standardization**: Ensures consistent configurations across different environments, minimizing discrepancies.

- **Audit Trails**: Every change is recorded in Git, providing a clear audit trail for accountability and traceability.

- **Rollbacks and Recovery**: Allows for easy rollbacks to previous configurations in case of errors or issues.

- **Enhanced Security**: Changes are reviewed through pull requests, increasing security and promoting collaboration among team members.

Software definitions are defined in this repository alongside the IaC and employ a customized [repo-per-team](https://fluxcd.io/flux/guides/repository-structure/#repo-per-team) pattern along with customized Helm charts.

- **Configuration Files**: YAML files that define the desired state of our components and applications.

- **Charts**: Helm charts used for defining, installing, and upgrading Kubernetes applications.

Our GitOps approach not only standardizes and secures the software management process but also **simplifies the deployment process**. By making it easier to maintain and update configurations, this approach ensures that deployments are both efficient and flexible. It allows for seamless integration of additional software configurations by pointing to alternate repositories that host these configurations. This extensibility enables our deployments to include not just the default software load but also any additional components required by our architecture.


### Stamp Layout

In our software architecture design, we define two primary software Kustomizations that describe a **stamp**. A Kustomization is a Flux resource representing a set of defined manifests that Flux should reconcile to the cluster, with dependencies between them. Structuring our Kustomizations this way ensures clarity and separation of concerns, making it easier to manage and organize both components and applications.
Expand Down Expand Up @@ -174,3 +155,78 @@ flowchart TD
│ └── source.yaml
```

__OSDU Core Structure__

The OSDU Core application is organized to facilitate the management of the OSDU core platform services. Below is the layout:

```mermaid
flowchart TD
base("base")
partition("partition")
partition_init("partition-init")
entitlements("entitlements")
entitlements_init("entitlements-init")
legal("legal")
indexer("indexer")
indexer_queue("indexer-queue")
user_init("user-init")
schema("schema")
schema_init("schema-init")
storage("storage")
file("file")
search("search")

base-->partition
partition-->entitlements
partition-->partition_init
entitlements-->entitlements_init
entitlements_init-->user_init
partition-->legal
legal-->indexer
legal-->indexer_queue
legal-->schema
schema-->schema_init
indexer_queue-->storage
indexer_queue-->file
indexer_queue-->search
```

```bash
── osdu-core
   ├── base.yaml
   ├── entitlements.yaml
   ├── file.yaml
   ├── indexer.yaml
   ├── legal.yaml
   ├── namespace.yaml
   ├── partition.yaml
   ├── schema.yaml
   ├── search.yaml
   ├── storage.yaml
   └── user-init.yaml
```

__OSDU Reference Structure__

The OSDU Reference application is organized to facilitate the management of the OSDU reference platform services. Below is the layout:

```mermaid
flowchart TD
base("base")
unit("unit")
crs-catalog("crs-catalog")
crs-conversion("crs-conversion")

base-->unit
base-->crs-catalog
base-->crs-conversion
```

```bash
── osdu-reference
   ├── base.yaml
   ├── crs-catalog.yaml
   ├── crs-conversion.yaml
   ├── namespace.yaml
   └── unit.yaml
```
15 changes: 6 additions & 9 deletions software/applications/osdu-core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,13 @@ flowchart TD
partition-->entitlements
partition-->partition_init
entitlements-->entitlements_init
partition_init-->entitlements_init
entitlements_init-->legal
entitlements_init-->user_init
partition-->legal
legal-->indexer
legal-->indexer_queue
entitlements_init-->user_init
indexer-->schema
indexer_queue-->schema
legal-->schema
schema-->schema_init
schema-->storage
schema-->file
storage-->search
file-->search
indexer_queue-->storage
indexer_queue-->file
indexer_queue-->search
```
3 changes: 3 additions & 0 deletions software/applications/osdu-core/file.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ metadata:
annotations:
clusterconfig.azure.com/use-managed-source: "true"
spec:
dependsOn:
- name: osdu-indexer-queue
namespace: osdu-core
targetNamespace: osdu-core
chart:
spec:
Expand Down
10 changes: 8 additions & 2 deletions software/applications/osdu-core/indexer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ metadata:
annotations:
clusterconfig.azure.com/use-managed-source: "true"
spec:
dependsOn:
- name: osdu-legal
namespace: osdu-core
targetNamespace: osdu-core
chart:
spec:
chart: ./charts/osdu-developer-service
Expand All @@ -19,7 +23,6 @@ spec:
install:
remediation:
retries: 3
targetNamespace: osdu-core
valuesFrom:
- kind: ConfigMap
name: configmap-software
Expand Down Expand Up @@ -147,6 +150,10 @@ metadata:
annotations:
clusterconfig.azure.com/use-managed-source: "true"
spec:
dependsOn:
- name: osdu-legal
namespace: osdu-core
targetNamespace: osdu-core
chart:
spec:
chart: ./charts/osdu-developer-service
Expand All @@ -159,7 +166,6 @@ spec:
install:
remediation:
retries: 3
targetNamespace: osdu-core
valuesFrom:
- kind: ConfigMap
name: configmap-software
Expand Down
3 changes: 3 additions & 0 deletions software/applications/osdu-core/legal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ metadata:
annotations:
clusterconfig.azure.com/use-managed-source: "true"
spec:
dependsOn:
- name: osdu-partition
namespace: osdu-core
targetNamespace: osdu-core
chart:
spec:
Expand Down
3 changes: 3 additions & 0 deletions software/applications/osdu-core/search.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ metadata:
annotations:
clusterconfig.azure.com/use-managed-source: "true"
spec:
dependsOn:
- name: osdu-indexer-queue
namespace: osdu-core
targetNamespace: osdu-core
chart:
spec:
Expand Down
3 changes: 3 additions & 0 deletions software/applications/osdu-core/storage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ metadata:
annotations:
clusterconfig.azure.com/use-managed-source: "true"
spec:
dependsOn:
- name: osdu-indexer-queue
namespace: osdu-core
chart:
spec:
chart: ./charts/osdu-developer-service
Expand Down