Skip to content

Commit

Permalink
Merge pull request #34 from ai-cfia/33-as-a-sre-i-would-like-to-chang…
Browse files Browse the repository at this point in the history
…e-line-length-rules-for-yaml-files-to-120

Issue #33:  Change yaml linting line length to 120
  • Loading branch information
SonOfLope authored Feb 12, 2024
2 parents d288063 + e03e54e commit 9a33843
Show file tree
Hide file tree
Showing 17 changed files with 512 additions and 490 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ jobs:
yaml-check:
uses:
ai-cfia/github-workflows/.github/workflows/workflow-yaml-check.yml@main
with:
config-file-path: '.yamllint.yml'

repo-standard:
uses:
Expand Down
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{
"editor.rulers": [80],
"[yaml]": {
"editor.rulers": [120]
},
"files.trimTrailingWhitespace": true,
"files.trimFinalNewlines": true,
"files.insertFinalNewline": true
Expand Down
7 changes: 7 additions & 0 deletions .yamllint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
extends: default

rules:
line-length:
max: 120
allow-non-breakable-inline-mappings: true
72 changes: 44 additions & 28 deletions apply-terraform.yml
Original file line number Diff line number Diff line change
@@ -1,61 +1,77 @@
---
trigger:
- main
branches:
include:
- main

pr: none

pool:
vmImage: 'ubuntu-latest'
vmImage: "ubuntu-latest"

variables:
- group: terraform-backend-settings

stages:
- stage: InitAndPlan
displayName: 'Initialize and Plan'
displayName: "Initialize and Plan"
jobs:
- job: TerraformInitPlan
displayName: 'Terraform Init and Plan'
displayName: "Terraform Init and Plan"
steps:
- task: TerraformTaskV2@2
displayName: Terra Init
inputs:
provider: 'azurerm'
command: 'init'
workingDirectory:
'$(System.DefaultWorkingDirectory)/terraform/staging'
backendServiceArm: '$(serviceConnectionName)'
backendAzureRmResourceGroupName: '$(resourceGroupName)'
backendAzureRmStorageAccountName: '$(storageAccountName)'
backendAzureRmContainerName: '$(containerName)'
backendAzureRmKey: '$(stateKey)'
provider: "azurerm"
command: "init"
workingDirectory: "$(System.DefaultWorkingDirectory)/terraform/staging"
backendServiceArm: "$(serviceConnectionName)"
backendAzureRmResourceGroupName: "$(resourceGroupName)"
backendAzureRmStorageAccountName: "$(storageAccountName)"
backendAzureRmContainerName: "$(containerName)"
backendAzureRmKey: "$(stateKey)"

- task: TerraformTaskV2@2
displayName: Terra Plan
inputs:
provider: 'azurerm'
command: 'plan'
workingDirectory:
'$(System.DefaultWorkingDirectory)/terraform/staging'
environmentServiceNameAzureRM: '$(serviceConnectionName)'
provider: "azurerm"
command: "plan"
workingDirectory: "$(System.DefaultWorkingDirectory)/terraform/staging"
environmentServiceNameAzureRM: "$(serviceConnectionName)"

- stage: Apply
displayName: 'Apply Terraform Plan'
displayName: "Apply Terraform Plan"
dependsOn: InitAndPlan
condition: succeeded()
jobs:
- job: TerraformInit
displayName: "Terraform Init"
steps:
- task: TerraformTaskV2@2
displayName: Terra Init
inputs:
provider: "azurerm"
command: "init"
workingDirectory: "$(System.DefaultWorkingDirectory)/terraform/staging"
backendServiceArm: "$(serviceConnectionName)"
backendAzureRmResourceGroupName: "$(resourceGroupName)"
backendAzureRmStorageAccountName: "$(storageAccountName)"
backendAzureRmContainerName: "$(containerName)"
backendAzureRmKey: "$(stateKey)"

- deployment: TerraformApply
displayName: 'Terraform Apply'
displayName: "Terraform Apply"
pool:
vmImage: 'ubuntu-latest'
environment: 'ProductionApproval'
vmImage: "ubuntu-latest"
environment: "ProductionApproval"
strategy:
runOnce:
deploy:
steps:
- task: TerraformTaskV2@2
displayName: 'Terra Apply'
displayName: "Terra Apply"
inputs:
provider: 'azurerm'
command: 'apply'
workingDirectory:
'$(System.DefaultWorkingDirectory)/terraform/staging'
environmentServiceNameAzureRM: '$(serviceConnectionName)'
provider: "azurerm"
command: "apply"
workingDirectory: "$(System.DefaultWorkingDirectory)/terraform/staging"
environmentServiceNameAzureRM: "$(serviceConnectionName)"
32 changes: 16 additions & 16 deletions kubernetes/apps/finesse/finesse-backend-deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,22 +45,22 @@ spec:
spec:
serviceAccountName: secrets-reader
containers:
- name: finesse-backend
image: ghcr.io/ai-cfia/finesse-backend:main
imagePullPolicy: Always
command: ["/bin/sh", "-c"]
args:
- >
cp /vault/secrets/.env . &&
gunicorn --bind :8080 --workers 1 --threads 8 --timeout 0 --forwarded-allow-ips "*" app:app
ports:
- containerPort: 8080
livenessProbe:
httpGet:
path: /health
port: 8080
initialDelaySeconds: 60
periodSeconds: 10
- name: finesse-backend
image: ghcr.io/ai-cfia/finesse-backend:main
imagePullPolicy: Always
command: ["/bin/sh", "-c"]
args:
- >
cp /vault/secrets/.env . &&
gunicorn --bind :8080 --workers 1 --threads 8 --timeout 0 --forwarded-allow-ips "*" app:app
ports:
- containerPort: 8080
livenessProbe:
httpGet:
path: /health
port: 8080
initialDelaySeconds: 60
periodSeconds: 10

---
apiVersion: v1
Expand Down
22 changes: 11 additions & 11 deletions kubernetes/apps/finesse/finesse-frontend-deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@ spec:
spec:
serviceAccountName: secrets-reader
containers:
- name: finesse-frontend
image: ghcr.io/ai-cfia/finesse-frontend:main
imagePullPolicy: Always
ports:
- containerPort: 3000
livenessProbe:
httpGet:
path: /health
port: 3000
initialDelaySeconds: 60
periodSeconds: 10
- name: finesse-frontend
image: ghcr.io/ai-cfia/finesse-frontend:main
imagePullPolicy: Always
ports:
- containerPort: 3000
livenessProbe:
httpGet:
path: /health
port: 3000
initialDelaySeconds: 60
periodSeconds: 10

---
apiVersion: v1
Expand Down
54 changes: 27 additions & 27 deletions kubernetes/apps/finesse/finesse-ingress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,27 @@ metadata:
namespace: finesse
annotations:
nginx.ingress.kubernetes.io/use-regex: "true"
nginx.ingress.kubernetes.io/rewrite-target: /$2 # https://kubernetes.github.io/ingress-nginx/examples/rewrite/
nginx.ingress.kubernetes.io/rewrite-target: /$2 # https://kubernetes.github.io/ingress-nginx/examples/rewrite/
cert-manager.io/cluster-issuer: letsencrypt-http
ingress.kubernetes.io/force-ssl-redirect: "true"
kubernetes.io/tls-acme: "true"
spec:
ingressClassName: nginx
tls:
- hosts:
- finesse.ninebasetwo.xyz
secretName: aciacfia-tls
- hosts:
- finesse.ninebasetwo.xyz
secretName: aciacfia-tls
rules:
- host: finesse.ninebasetwo.xyz
http:
paths:
- path: /api(/|$)(.*)
pathType: ImplementationSpecific
backend:
service:
name: finesse-backend-svc
port:
number: 8080
- host: finesse.ninebasetwo.xyz
http:
paths:
- path: /api(/|$)(.*)
pathType: ImplementationSpecific
backend:
service:
name: finesse-backend-svc
port:
number: 8080

---
# For more information check https://github.com/nginxinc/kubernetes-ingress/issues/323
Expand All @@ -44,17 +44,17 @@ metadata:
spec:
ingressClassName: nginx
tls:
- hosts:
- finesse.ninebasetwo.xyz
secretName: aciacfia-tls
- hosts:
- finesse.ninebasetwo.xyz
secretName: aciacfia-tls
rules:
- host: finesse.ninebasetwo.xyz
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: finesse-frontend-svc
port:
number: 3000
- host: finesse.ninebasetwo.xyz
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: finesse-frontend-svc
port:
number: 3000
30 changes: 15 additions & 15 deletions kubernetes/apps/nachet/nachet-backend-deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,21 +38,21 @@ spec:
spec:
serviceAccountName: secrets-reader
containers:
- name: nachet-backend
image: ghcr.io/ai-cfia/nachet-backend:48
imagePullPolicy: Always
command: ["/bin/sh", "-c"]
args:
- >
cp /vault/secrets/.env . && hypercorn -b :8080 app:app
ports:
- containerPort: 8080
livenessProbe:
httpGet:
path: /health
port: 8080
initialDelaySeconds: 60
periodSeconds: 10
- name: nachet-backend
image: ghcr.io/ai-cfia/nachet-backend:48
imagePullPolicy: Always
command: ["/bin/sh", "-c"]
args:
- >
cp /vault/secrets/.env . && hypercorn -b :8080 app:app
ports:
- containerPort: 8080
livenessProbe:
httpGet:
path: /health
port: 8080
initialDelaySeconds: 60
periodSeconds: 10

---
apiVersion: v1
Expand Down
25 changes: 13 additions & 12 deletions kubernetes/apps/nachet/nachet-frontend-deployment.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
Expand All @@ -15,21 +16,21 @@ spec:
spec:
serviceAccountName: secrets-reader
containers:
- name: nachet-frontend
image: ghcr.io/ai-cfia/nachet-frontend:main
imagePullPolicy: Always
ports:
- containerPort: 3000
livenessProbe:
httpGet:
path: /
port: 3000
initialDelaySeconds: 60
periodSeconds: 10
- name: nachet-frontend
image: ghcr.io/ai-cfia/nachet-frontend:main
imagePullPolicy: Always
ports:
- containerPort: 3000
livenessProbe:
httpGet:
path: /
port: 3000
initialDelaySeconds: 60
periodSeconds: 10

---
apiVersion: v1
kind: Service
kind: Service
metadata:
name: nachet-frontend-svc
namespace: nachet
Expand Down
Loading

0 comments on commit 9a33843

Please sign in to comment.