# Introduction The workspace config defines the workspace for the bakery. The workspace includes * A tree structure - where to place all the files required to build * Docker - how to run docker # Default Workspace The default tree structure of the Bakery workspace would be something like ```bash ├── artifacts ├── buildconfig.json ├── builds ├── .cache ├── docker ├── layers ├── scripts └── workspace.json ``` This is what is used if the workspace contains a workspace.json with the following content ```json { "version": "5" } ``` Any or of the directories in the workspace can be it's own git repo either by using git submodules or by using the android repo tool. More on this will be covered in the [Setup Workspace](#Setup-Workspace). ## Artifacts The artifacts directory is where bakery will collect all artifacts. A artifact can be any files from the build that the build config lists for bakery to collect. It can also be a link to a file or a manifest file containing build data from the build collected by bakery or it can be an archive file containing whatever defined in the build config. For more information on how to configure bakery to collect artifacts please see [Build Config](build-config.md#Artifacts). ## Cache The cache dir is the location where bakery tells bitbake to place the build cache. The bitbake build cache is made of two directories * download - all external sources that bitbake will be fetching will be put in this directory. * sstate - the sstate chache is the real build data to speed up the build once already built. These resources are crucial for bitbake to speed up the build once a full build have been completed. ## Builds The builds directory is dynamically generated by bitbake and will contain all the build data from the build. It is also in this directory that the bitbake configuration files defined in the build config file will be generated in. For more information on the build config and the bitbake configuration files please see [Build Config](build-config.md#LocalConf). ## Docker The docker directory is not required and is only if the docker image used by bakery is a custome one and it makes sens to have it as part of the workspace. ## Layers The layers directory is where the meta data used to describe the OE/Yocto project is placed for more information on this topic please refere to [Meta Layers](meta-layers.md). The layers directory is required. ## Scripts The scripts directory is optional but it can be usefull to have a directory to define scripts if additional scripts are required as part of the build process outside of the bitbake process and bakery should be aware of them to call them. For more information on how to let bakery use these scripts please refere to [Build Config](build-config.md#Tasks) ## Customize Sometimes one or all of the directories needs to be renamed or moved. The workspace can be customized in any way as long as bakery is aware of that change by adjusting the workspace config file. This is the workspace config and any value in it can be changed. ```json { "version": "5", "builds": { "supported": [ ] }, "workspace": { "configsdir": "", "artifactsdir": "artifacts", "layersdir": "layers", "scriptsdir": "scripts", "buildsdir": "builds", "dockerdir": "docker", "cachedir": ".cache", }, "docker": { "disabled": "false", "topdir": "", "registry": "bakery", "image": "bakery-workspace", "tag": "x.y.z", "args": [ ] } } ``` In the example workspace config above all values are set to match the default values if nothing is specified. ### builds The builds node in the workspace config lists workspace options for the supported builds or products that the workspace can build. Currently the only option is to list what build configs that this workspace is supporting. #### supported The list of supported build config that the workspace supports can be listed in the workspace config. If the list is empty all available build config will be possible to execute. If the list is populated then only the build configs in this list can be used. This can be usefull when currently working on a new build config in a workspace that is not ready to be used but should be commited and available for some to try out. ```json { "version": "5", "builds": { "supported": [ "config1", "config2" ] }, } ``` ### workspace The workspace node is to define the workspace tree structure. All have been covered previously in [Default Workspace](#Default-Workspace). ### docker The docker node in the workspace config is where docker is managed for the current workspace. #### disabled It is possible to use bakery without docker but some features will be lost if not using docker. To disable docker set the value to true. ```json { "version": "5", "docker": { "disabled": "false" } } ``` Everything will work as before except it will simply be executed without executing inside docker. #### topdir The topdir is a special case where the build running inside docker needs access to some resource outside of the workspace directory. A relative path from the location of the workspace can then be specified in the topdir. ```json { "version": "5", "docker": { "topdir": ".." } } ``` #### tag A specific tag for a docker image can be specified ```json { "version": "5", "docker": { "tag": "0.1.36" } } ``` #### registry A specific docker registry can be selected ```json { "version": "5", "docker": { "registry": "my-registry" } } ``` #### image A customized docker image can be selected ```json { "version": "5", "docker": { "image": "my-image" } } ``` ## Setup Workspace Bakery is a tool for setting up the content of the workspace. There are normally two ways of setting up a workspace * git submodules * repo android tool The reason for using these tools is because when setting up the meta data in the layers there will be multiple git repos required. For more information on this topic please see [Meta Layers](meta-layers.md).