Skip to content

Commit

Permalink
Make a demo with handcrafted schemas
Browse files Browse the repository at this point in the history
Nest schema

Merge into single schema

Detail out schema

Fix some parameters

Add schema release action
  • Loading branch information
marcelldls committed Jun 4, 2024
1 parent e41ab8f commit a66f745
Show file tree
Hide file tree
Showing 3 changed files with 217 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/schema_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Publish schemas

on:
push

jobs:
release:
# Release on tag push - publish schema
if: ${{ github.ref_type == 'tag' }}
runs-on: ubuntu-latest

steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Github Release
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v0.1.15
with:
files: |
Schemas/*.schema.json
generate_release_notes: true
2 changes: 2 additions & 0 deletions Charts/ioc-instance/values.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# yaml-language-server: $schema=../../Schemas/ioc-instance.json#/$defs/base

# default values for all IOCs
# see end of file for values that may be overridden per individual IOC

Expand Down
195 changes: 195 additions & 0 deletions Schemas/ioc-instance.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,195 @@
{
"$defs":{
"base": {
"type": "object",
"properties": {
"beamline": {
"type": "string",
"description": "The beamline name."
},
"location": {
"type": "string",
"description": "The location where the IOCs will run - same as beamline for beamlines"
},
"ioc_group": {
"type": "string",
"description": "The name of the repository in which the IOC is grouped - same as beamline for beamlines"
},
"hostNetwork": {
"type": "boolean",
"description": "Use host network for IOC - required for Channel Access to work outside of the cluster"
},
"useAffinity": {
"type": "boolean",
"description": "Run only on nodes with label beamline:<beamline-name> or location:<location-name>"
},
"iocFolder": {
"type": "string",
"description": "Root folder for ioc source/binaries inside generic IOC container",
"default": "/epics/ioc"
},
"iocConfig": {
"type": "string",
"description": "Root folder for ioc source/binaries inside generic IOC container",
"default": "/epics/ioc/config"
},
"startCommand": {
"type": "string",
"description": "The command run as the entry point of the container.",
"default": "bash"
},
"startArgs": {
"type": "string",
"description": "The arguments for the entry point of the container.",
"default": "/epics/ioc/start.sh"
},
"stop": {
"type": "string",
"description": "Script run before stopping the IOC",
"default": "/epics/ioc/stop.sh"
},
"liveness": {
"type": "string",
"description": "Script for determining the liveness of the IOC",
"default": "/epics/ioc/liveness.sh"
},
"globalEnv": {
"type": "string",
"description": ""
},
"securityContext": {
"type": "object",
"description": "Override runAsXXX in the individual IOC values.yaml",
"properties": {
"allowPrivilegeEscalation": {
"type": "boolean",
"description": "",
"default": "false"
},
"runAsUser": {
"type": "integer"
},
"runAsGroup": {
"type": "integer"
},
"capabilities": {
"type": "object"
},
"readOnlyRootFilesystem": {
"type": "string"
},
"runAsNonRoot": {
"type": "string"
}
}
},
"image": {
"type": "string",
"description": ""
},
"dataVolume": {
"type": "object",
"description": "A volume to mount for writing data to. This can be a PVC or a hostPath",
"properties": {
"pvc": {
"type": "boolean",
"description": "Create a PVC called {{ .Release.Name }}-data when true",
"default": "true"
},
"hostPath": {
"type": "string",
"description": "A path on the host machine to write data into. Also used as the path that the pvc or hostPath will be mounted at so that users need not be confused about inside/outside container paths",
"default": "/data"
}
}
},
"opisClaim": {
"type": "string",
"description": "Use the shared PVC for publishing opi files over http (see services/opis)"
},
"runtimeClaim": {
"type": "string",
"description": "Use the shared PVC for holding runtime files for each IOC"
},
"autosaveClaim": {
"type": "string",
"description": "Use the shared PVC autosave files (exclude for no autosave)"
},
"resources": {
"type": "object",
"description": "Set resource limits",
"properties": {
"limits": {
"type": "object",
"properties":{
"cpu": {
"type": "string",
"default": "500m"
},
"memory": {
"type": "string",
"default": "256Mi"
}
}
},
"requests": {
"type": "object",
"properties":{
"cpu": {
"type": "string",
"default": "100m"
},
"memory": {
"type": "string",
"default": "64Mi"
}
}
}
}
},
"tolerations": {
"type": "object",
"description": "Extra tolerations if needed"
}
},
"additionalProperties": false
},
"repo":{
"type": "object",
"properties": {
"ioc-instance": {
"$ref": "#/$defs/base",
"required": [
"autosaveClaim",
"beamline",
"dataVolume",
"globalEnv",
"hostNetwork",
"useAffinity",
"ioc_group",
"location",
"opisClaim",
"runtimeClaim",
"securityContext"
]
}
}
},
"service":{
"type": "object",
"properties": {
"shared": {
"type": "object",
"properties": {
"ioc-instance": {
"$ref": "#/$defs/base",
"required": [
"image"
]
}
}
}
}
}
}
}

0 comments on commit a66f745

Please sign in to comment.