You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Background Information: Since confirmed it worked, we can have buildscript generate the Dockerfile, send it over to the artifact storage, then start another container on ad-build that is root/privliged so it can build the image from the Dockerfile and push to the registry. 
Possible workflow: Buildscript generate Dockerfile → api request to artifact storage to build → artifact storage starts container to build Dockerfile.
TODO: We can make the rest api ourselves, (django/flask framework, and swagger ui for doc?) 
This artifact storage process/container should have logic to build dockerfile images, and components themselves. It'll be a middle man accepting client requests, and starting up containers to do its work.
Then the artifact storage container can just return the filepath to copy the built components from
Come up with api definitions and what we need, then go over with Jerry, and see if we should use django or flask
authenticate rest api with api key to pass to build containers.

(POST) Build Image:

'headers': {
    "linux_username": "string",
    "github_username": "string"
},
'body': {
    "dockerfile": file,
    "component": "string",
    "branch": "string",
	"architecture": "string" // OS environment
}

Behavior/Flow

  1. Given the input information, the backend creates builds the dockerfile given, with the name as <component>-<branch>-image:<tag>
    1. TODO: Come up with image naming convention
  2. The image is then stored into the artifact storage registry, available for use to test/deploy/dev environment

Return

{
    "status": "string"
    "errorMessage": "string"
}

(GET) Get Image:

'headers': {
    "linux_username": "string",
    "github_username": "string"
},
'body': {
    "component": "string",
    "branch": "string",
	"architecture": "string" // OS environment
}

Behavior/Flow

  1. Given the input information, the backend checks if image exists for a certain component.
    1. if not exists: then return none, 
    2. if exists: return the name of the image, possibly a command on how to pull the image

Return

{
    "status": "string"
    "errorMessage": "string"
	"imageName": "string"
}

(POST) Build Component:

'headers': {
    "linux_username": "string",
    "github_username": "string"
},
'body': {
    "url": "string",
    "component": "string",
    "tag": "string" ,
	"architecture": "string" // OS environment
}

Behavior/Flow

  1. Given the input information, the backend clones the component, and builds it based off instructions in the repo itself
  2. The component is then stored in artifact storage, where it can be used as a dependency for other components

Return

{
    "status": "string"
    "errorMessage": "string"
}

(GET) Get component:

'headers': {
    "linux_username": "string",
    "github_username": "string"
},
'body': {
    "component": "string",
    "tag": "string",
	"architecture": "string" // OS environment
}

Behavior/Flow

  1. Given the input information, the backend checks to see if component exists in artifact storage, 
    1. if not exists: then clone and build the component in the artifact storage
    2. if exists: (TBD) either return the component itself, by zipping up the folder, or return the filepath to the component, and the client can just copy it over

Return

{
    "status": "string"
    "errorMessage": "string" // Optional
	"component": "string" // TBD (return filepath or component itself)
}
  • No labels