Image and Build
Note
While using TrueFoundry python SDK
type
is not a required field in any of the imported classes
For image you can either give link to a pre-existing image viaImage
module, or give instructions on how to build the image via theBuild
class
Image
Description
Describes that we are using a pre-built image stored in a Docker Image registry
Schema
{
"type": "string",
"image_uri": "string",
"docker_registry": "string",
"command": null
}
Properties
Name | Type | Required | Description |
---|---|---|---|
type | string | true | + value=image |
image_uri | string | true | The image URI. Specify the name of the image and the tag. |
docker_registry | string | false | FQN of the container registry. You can the FQN of your desired container registry (or add one) |
command | any | false | Override the command to run when container starts. |
Build
Description
Describes how we build our code into a Docker image.
Schema
{
"type": "string",
"docker_registry": "string",
"build_source": {},
"build_spec": {}
}
Properties
Name | Type | Required | Description |
---|---|---|---|
type | string | true | + value=build |
docker_registry | string | false | FQN of the container registry. You can the FQN of your desired container registry (or add one) |
build_source | object | true | Source code location. |
build_spec | object | true | Instructions to build a container image out of the build source |
Build Spec
The modules below help define the build specification.
PythonBuild
Description
Describes that we are using python to build a container image with a specific python version and pip packages installed.
Schema
{
"type": "string",
"python_version": "3.9",
"build_context_path": "./",
"requirements_path": "string",
"pip_packages": [
"string"
],
"apt_packages": [
"string"
],
"command": null,
"cuda_version": "string"
}
Properties
Name | Type | Required | Description |
---|---|---|---|
type | string | true | + value=tfy-python-buildpack |
python_version | string | true | Python version to run your application. Should be one of the tags listed on |
build_context_path | string | true | Build path relative to project root path. |
requirements_path | string | false | Path to |
pip_packages | [string] | false | Define pip package requirements. |
apt_packages | [string] | false | Debian packages to install via |
command | any | true | Command to run when the container starts. |
cuda_version | string | false | Version of CUDA Toolkit and CUDNN to install in the image |
DockerFileBuild
Description
Describes that we are using a dockerfile to build our image
Schema
{
"type": "string",
"dockerfile_path": "./Dockerfile",
"build_context_path": "./",
"command": null,
"build_args": {
"property1": "string",
"property2": "string"
}
}
Properties
Name | Type | Required | Description |
---|---|---|---|
type | string | true | + value=dockerfile |
dockerfile_path | string | true | The file path of the Dockerfile relative to project root path. |
build_context_path | string | true | Build context path for the Dockerfile relative to project root path. |
command | any | false | Override the command to run when the container starts |
build_args | object | false | Build arguments to pass to
. |
Build Source
The modules below help define the build specification.
LocalSource
Description
Describes that we are using code stored in a local developement environment to build our image
Schema
{
"type": "string",
"project_root_path": "./",
"local_build": true
}
Properties
Name | Type | Required | Description |
---|---|---|---|
type | string | true | + value=local |
project_root_path | string | true | Local project root path. |
local_build | boolean | true | run docker build locally |
GitSource
Description
Describes that we are using code stored in a git repository to build our image
Schema
{
"type": "string",
"repo_url": "string",
"ref": "string",
"branch_name": "string"
}
Properties
Name | Type | Required | Description |
---|---|---|---|
type | string | true | + value=git |
repo_url | string | true | The repository URL. |
ref | string | true | The commit SHA. |
branch_name | string | false | Selecting branch will select latest commit SHA of the branch. |
RemoteSource
Description
Describes that we are using code stored in a remote respository to build our image
Schema
{
"type": "string",
"remote_uri": "string"
}
Properties
Name | Type | Required | Description |
---|---|---|---|
type | string | true | + value=remote |
remote_uri | string | true | Remote repository URI |
Updated about 1 month ago