You are viewing an old version of this page. View the current version.
Compare with Current
View Page History
« Previous
Version 8
Next »
Page about component & deployment databases
Component Database
Resources
Backend API/CLI to the MongoDB component database: eed-web-application/build-environment-builder (github.com)
API Documentation: Swagger UI (stanford.edu)
Potential Schema
/* new schema for component db */
// Note - Not all fields are populated depending on the api endpoint
component_schema
{
"id": "", // Primary Key of json object
"name": "", // Name of component (corresponds to name of repository)
"organization": "", // Name of organization
"description": "", // Description of component
"version": "", // Version of component schema (NOT the repo version)
"environment": "", // Build/Runtime environment - ex: ['rhel7', 'rhel8', 'matlab'] which may or may not contain components
"url": "", // URL/filepath to the component object
"approvalRule": "", // Determines what kind of approval was done - ex: ['all', 'none'] determined by approval rule
"approvalGroup": [ // Names of experts on the component (possibly group names in addition to individuals)
"",
"",
],
"testingCriteria": "", // Determines acceptance criteria for testing - ex: ['all', '90%']
"dependsOnComponents": [ // Component dependencies
{"name": "", "tagname": ""},
{"name": "", "tagname": ""}
]
}
// Q: can a component have 2 or more environments (os)?
// note - maybe the environment moves to an additional dependsOnComponents entry - maybe the first entry?
/* Example */
{
"id": "663e591ce77eef11eb66a54f",
"name": "mps_central_node",
"organization": "slaclab",
"description": "central node for machine protection system",
"version": "1",
"environment": "rhel7.9",
"url": "s3df/slaclab/mps_central_node",
"approvalRule": "all",
"approvalGroup": [
"Jerry Katzung",
"Patrick Nisperos",
],
"dependsOnComponents": [
{"name": "slaclab/epics", "tagname": "epics-72"},
{"name": "slaclab/python", "tagname": "python-45"}
]
}
/* TODO: Make another table/document for tracking branches in flight */
// Note - useful when we want to report to developers where certain branches are
// note - expected to be dynamic
branches_in_development_schema
{
"id": "", // id of entry
"name": "", // name of repo
"organization": "", // name of organization
"branchName": "", // name of branch
"approvalStatus": "", // Status of approval - ex: ['approved', 'rejected', 'in progress']
"testingStatus": "", // Status of testing - ex: ['pass', 'fail', 'in progress']
"overallStatus": "" // Status at the final state - ex: ['merged', 'rejected', 'deleted']
}
// Q: does testLocation information get tracked in here?
deployment_schema
{
"id": "", // id of entry
"name": "", // name of repo
"organization": "", // name of organization
"tagName": "", // name of tag
"host": "", // Host hardware
"deploymentStatus": "" // Status at the final state - ex: ['provisional', 'active']
}
// Note - when in provisional state, during pamm ansible will look at the name/org/tag to install the packages
// developer updates the deploymentStatus if good, or not good
// if good: then ansible leaves it alone
// if bad: then engineer reverts to previous tag and marks active, then ansible reverts to previous tags and installs previous package
Other Notes
- cbs - core build system
- docker-compose.yml file is used to create the database locally (for development purposes). Where you would use a 'docker compose up' command to execute
README.md (Since there isn't one on the repo)
How to build:
Disclaimer: I've only tried this on vscode, since the repo already made support to create the development environment for vscode using (devcontainer.json)
- Open up the repo in vscode, and you will be prompted to open up the devcontainer.
- Click yes, give it a few minutes to setup, it will run docker-compose.yml which will setup the mongodb locally
- Now that your development environment is setup, open up a terminal in vscode. Which should open you in the container, at folder '/workspace'
- Do a 'make build'
![](/download/attachments/446504291/image-2024-5-3_11-22-22.png?version=1&modificationDate=1714760542364&api=v2)
At the moment there is errors- I solved the vcs status error by
- do a git status
- follow the command it outputs
![](/download/attachments/446504291/image-2024-5-3_11-23-49.png?version=1&modificationDate=1714760629057&api=v2)
- Got rid of the error:
![](/download/attachments/446504291/image-2024-5-3_11-24-40.png?version=1&modificationDate=1714760680645&api=v2)
- I solved the malformed import path "-o": leading dash by
- Edit line 8 in makefile
Original: go build ./... -o cbs
New: go build -o cbs ./...
- Then it should be able to run
- Example
![](/download/attachments/446504291/image-2024-5-3_15-33-55.png?version=1&modificationDate=1714775635412&api=v2)
How to run:
TBD
- Component list
- ./build-environment-builder component -h
- Specify a label (endpoint), but seems that no labels are configured. Check configure.go with the "add your map here" I think you specify the yaml
- Seems like this only works in vscode dev container, because the server is running there (update: Maybe not actually, since when you do docker ps, you'll see the containers that were started because of vscode (Which runs docker compose up))
- I first did a './build-environment-builder configure endpoint --label=dev --url=http://cbs:8080/api/' to create a label (endpoint)
- Then when i try to use it when listing components: './build-environment-builder component list --label=dev', it seems to connect to server, but gives error, probably because i have no components in it
- tip: do an 'echo=$EDITOR' and if you dont have anything specified, set it to vim. Otherwise, in this next step, when you create a component, it'll open up in nano.
- './build-environment-builder component list --label=dev'
- Left off here
Deployment Database
TBD