Skip to content

Commit 5418678

Browse files
Document OCTOPUS__Git__CacheFullThresholdMb env var (#3087)
* Document OCTOPUS__Git__CacheFullThresholdMb env var * Fix inaccurate list of affected operations * Add converting to VCS as affected operation * Fix markdownlint errors in config-as-code-reference * Remove heading ID that breaks MDX parser
1 parent 444144f commit 5418678

1 file changed

Lines changed: 75 additions & 67 deletions

File tree

src/pages/docs/projects/version-control/config-as-code-reference.mdx

Lines changed: 75 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,18 @@ Currently, the Project level resources saved to Git are:
2121

2222
- Deployment Process
2323
- Deployment Settings
24-
- Release Versioning
25-
- Release Notes Template
26-
- Deployment Targets Required
27-
- Transient Deployment Targets
28-
- Deployment Changes Template
29-
- Default Failure Mode
24+
- Release Versioning
25+
- Release Notes Template
26+
- Deployment Targets Required
27+
- Transient Deployment Targets
28+
- Deployment Changes Template
29+
- Default Failure Mode
3030
- Runbook Process
3131
- Runbook Settings
32-
- Multi-tenancy Mode
33-
- Run Retention Policy
34-
- Connectivity Policy
35-
- Default Failure Mode
32+
- Multi-tenancy Mode
33+
- Run Retention Policy
34+
- Connectivity Policy
35+
- Default Failure Mode
3636
- Variables (excluding Sensitive variables)
3737

3838
:::div{.hint}
@@ -49,11 +49,11 @@ Currently, the Project level resources saved to SQL Server when version control
4949
- Deployments
5050
- Sensitive Variables
5151
- General Settings
52-
- Project Name
53-
- Enabled / Disabled
54-
- Logo
55-
- Description
56-
- Project Group
52+
- Project Name
53+
- Enabled / Disabled
54+
- Logo
55+
- Description
56+
- Project Group
5757

5858
:::div{.hint}
5959
Sensitive Variables are planned for future releases of config-as-code.
@@ -64,36 +64,36 @@ Sensitive Variables are planned for future releases of config-as-code.
6464
The config-as-code feature manages project-level resources. However, it is worth explicitly mentioning some things that are **not included**:
6565

6666
- Infrastructure
67-
- Environments
68-
- Deployment Targets
69-
- Workers
70-
- Worker Pools
71-
- Machine Policies
72-
- Machine Proxies
73-
- Accounts
67+
- Environments
68+
- Deployment Targets
69+
- Workers
70+
- Worker Pools
71+
- Machine Policies
72+
- Machine Proxies
73+
- Accounts
7474
- Tenants
7575
- Library
76-
- Certificates
77-
- External Feeds
78-
- Lifecycles
79-
- Packages
80-
- Build Information
81-
- Script Modules
82-
- Step Templates
83-
- Variable Sets
76+
- Certificates
77+
- External Feeds
78+
- Lifecycles
79+
- Packages
80+
- Build Information
81+
- Script Modules
82+
- Step Templates
83+
- Variable Sets
8484
- Server Configuration
85-
- Feature Flags
86-
- License
87-
- Node Settings (Task Cap and Server Uri)
88-
- Issue Tracker Settings
89-
- External Auth Provider Settings
90-
- SMTP
91-
- Spaces
92-
- Teams (both membership and role assignment)
93-
- Users
94-
- User Roles
95-
96-
Currently, there are no plans to include these resources in the config-as-code feature. Several of the resources above can be put into version control using the [Octopus Terraform Provider](https://registry.terraform.io/providers/OctopusDeployLabs/octopusdeploy/latest/docs).
85+
- Feature Flags
86+
- License
87+
- Node Settings (Task Cap and Server Uri)
88+
- Issue Tracker Settings
89+
- External Auth Provider Settings
90+
- SMTP
91+
- Spaces
92+
- Teams (both membership and role assignment)
93+
- Users
94+
- User Roles
95+
96+
Currently, there are no plans to include these resources in the config-as-code feature. Several of the resources above can be put into version control using the [Octopus Terraform Provider](https://registry.terraform.io/providers/OctopusDeployLabs/octopusdeploy/latest/docs).
9797

9898
:::div{.hint}
9999
Resources managed by the Octopus Terraform Provider will have their state managed by Terraform. Resources managed by the Octopus config-as-code feature will have the state managed by Octopus Deploy. The two are not the same and shouldn't be treated as such.
@@ -105,36 +105,37 @@ Project version control settings can be accessed by clicking on the **Settings
105105

106106
### Git repository
107107

108-
The _Git Repository_ field should contain the URL for the repository you wish the Octopus configuration to be persisted to. e.g. `https://github.com/OctopusSamples/OctoFX.git`
108+
The *Git Repository* field should contain the URL for the repository you wish the Octopus configuration to be persisted to. e.g. `https://github.com/OctopusSamples/OctoFX.git`
109109

110110
<VersionControlRepositoryUrlFormat />
111111

112112
The repository must be initialized (i.e. contain at least one branch) prior to saving. Octopus will convert the existing items in the project to OCL (Octopus Configuration Language) and save it to that repository when you click save. If the repository isn't initialized, that will fail.
113113

114114
### Authentication
115115

116-
The config-as-code feature is designed to work with _any_ Git repository. When configuring a project to be version-controlled, you can optionally provide credentials for authentication.
116+
The config-as-code feature is designed to work with *any* Git repository. When configuring a project to be version-controlled, you can optionally provide credentials for authentication.
117117

118118
:::div{.hint}
119119
Do not use credentials from a personal account. Select a shared or service account. When Octopus Deploy saves to your Git repo, you will typically see the message `[User Name] authored and [Service Account] committed on [Date].`
120120
:::
121121

122122
For the Password field, we recommend using a personal access token. We also recommend that you follow the principle of least privilege when selecting scopes or permissions to grant this personal access token.
123123

124-
Git providers allow you to create an access token in different ways. The recommended _scope_ for each provider is listed in brackets.
124+
Git providers allow you to create an access token in different ways. The recommended *scope* for each provider is listed in brackets.
125125

126-
- [GitHub - Creating a fine-grained personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token#creating-a-fine-grained-personal-access-token); (Permission - `Contents - Read and Write`)
127-
- [GitHub - Creating a personal access token (Classic)](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token#creating-a-personal-access-token-classic); (Scope - `repo`)
128-
- [Azure DevOps](https://docs.microsoft.com/en-us/azure/devops/organizations/accounts/use-personal-access-tokens-to-authenticate); (Scope - `vso.code_full`)
129-
- [GitLab](https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html); (Scope - `write_repository`)
130-
- [BitBucket Server](https://confluence.atlassian.com/bitbucketserver063/personal-access-tokens-972354166.html); (Permission - `Project admin`)
131-
- [BitBucket Cloud - Use App Passwords](https://support.atlassian.com/bitbucket-cloud/docs/app-passwords/); (Permission - `Repositories - Read & Write`)
126+
- [GitHub - Creating a fine-grained personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token#creating-a-fine-grained-personal-access-token); (Permission - `Contents - Read and Write`)
127+
- [GitHub - Creating a personal access token (Classic)](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token#creating-a-personal-access-token-classic); (Scope - `repo`)
128+
- [Azure DevOps](https://docs.microsoft.com/en-us/azure/devops/organizations/accounts/use-personal-access-tokens-to-authenticate); (Scope - `vso.code_full`)
129+
- [GitLab](https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html); (Scope - `write_repository`)
130+
- [BitBucket Server](https://confluence.atlassian.com/bitbucketserver063/personal-access-tokens-972354166.html); (Permission - `Project admin`)
131+
- [BitBucket Cloud - Use App Passwords](https://support.atlassian.com/bitbucket-cloud/docs/app-passwords/); (Permission - `Repositories - Read & Write`)
132132

133133
:::div{.hint}
134134
Some VCS providers require that you use only a username and personal access token for authentication, not an email address (i.e. BitBucket).
135135
:::
136136

137137
#### BitBucket repository access tokens
138+
138139
BitBucket's repository access tokens allow you to create repository-specific access tokens. For these to work with your Git repositories in Octopus, you must set the username to `x-token-auth`, and the password to the token.
139140

140141
:::figure
@@ -143,7 +144,7 @@ BitBucket's repository access tokens allow you to create repository-specific acc
143144

144145
### File storage
145146

146-
_Git File Storage Directory_ specifies the path within the repository where the Octopus configuration will be stored. The default directory is `.octopus`, but that can be changed. If only a single Octopus project will be stored in the repo, we recommend putting the configuration directly under the `.octopus` directory.
147+
*Git File Storage Directory* specifies the path within the repository where the Octopus configuration will be stored. The default directory is `.octopus`, but that can be changed. If only a single Octopus project will be stored in the repo, we recommend putting the configuration directly under the `.octopus` directory.
147148

148149
:::div{.hint}
149150
If multiple projects will be persisted to the repository, adding the project name to the path is the recommended convention, e.g. `./octopus/acme`
@@ -155,9 +156,9 @@ We recommend storing projects alongside the application code. While it is possib
155156

156157
#### Default branch name
157158

158-
The _Default Branch Name_ is the branch on which the Octopus configuration will be written. It is also the default branch that will be used in various situations, for example:
159+
The *Default Branch Name* is the branch on which the Octopus configuration will be written. It is also the default branch that will be used in various situations, for example:
159160

160-
- When users view the project's deployment process for the first time in the Octopus UI, this is the initially selected branch
161+
- When users view the project's deployment process for the first time in the Octopus UI, this is the initially selected branch
161162
- When creating releases, this will be the default branch selected
162163
- When running Runbooks, variable values will be pulled from this branch
163164

@@ -169,31 +170,37 @@ When snapshotting a Runbook in a Git project that is not yet using config-as-cod
169170

170171
#### Initial commit branch
171172

172-
If the default branch is protected in your repository, select the *Is the default branch protected?* checkbox. This will allow you to use a different _Initial Commit Branch_. If this branch does not exist, Octopus will create the branch automatically.
173+
If the default branch is protected in your repository, select the *Is the default branch protected?* checkbox. This will allow you to use a different *Initial Commit Branch*. If this branch does not exist, Octopus will create the branch automatically.
173174

174-
The Octopus configurations will be written to the initial commit branch instead of the default branch. You will need to merge the changes from this branch into the default branch outside of Octopus.
175+
The Octopus configurations will be written to the initial commit branch instead of the default branch. You will need to merge the changes from this branch into the default branch outside of Octopus.
175176

176177
#### Protected branches pattern
177178

178179
You can also nominate protected branches for your Project. This will prevent users from making direct commits to the nominated branches from the Octopus UI and encourage them to create a new branch instead. To nominate protected branches, type in the name or a wildcard pattern in the Protected Branches Pattern field under Branch Settings. This will apply to all existing and future branches.
179180

181+
## Git repository cache
182+
183+
Octopus Server caches Git repositories locally in the `Git` subdirectory of the server home directory. This cache has a default size limit of **20 GB**. When exceeded, Git operations such as creating releases, deploying, or converting projects to version control will fail with:
180184

185+
> Unable to perform this operation as the local git cache is using more space than is available as set by the configured limit of 20 GB. Please use a smaller repository or remove any not in use.
186+
187+
To change the limit, set the `OCTOPUS__Git__CacheFullThresholdMb` system environment variable to the desired value in **megabytes** (e.g. `30720` for 30 GB), then **restart the Octopus Server service**. Setting the value to `0` disables the limit.
181188

182189
## OCL files
183190

184191
After successfully configuring a project to be version controlled, the specified Git repository will be populated with a set of Octopus Configuration Language (OCL) files. These files are created in the directory you define during setup. E.g. `./octopus/acme`
185192

186193
Currently, Octopus creates the following files and folders:
187194

188-
* deployment_process.ocl
189-
* deployment_settings.ocl
190-
* variables.ocl
191-
* schema_version.ocl
192-
* runbooks/
195+
- deployment_process.ocl
196+
- deployment_settings.ocl
197+
- variables.ocl
198+
- schema_version.ocl
199+
- runbooks/
193200

194-
The runbooks/ directory will contain runbook-name.ocl files for any published runbooks.
201+
The runbooks/ directory will contain runbook-name.ocl files for any published runbooks.
195202

196-
The _deployment_process.ocl_ file contains the configuration for your project's steps. Below is an example _deployment_process.ocl_ for a project containing a single _Deploy a Package_ step.
203+
The *deployment_process.ocl* file contains the configuration for your project's steps. Below is an example *deployment_process.ocl* for a project containing a single *Deploy a Package* step.
197204

198205
```hcl
199206
step "deploy-a-package" {
@@ -227,7 +234,7 @@ step "deploy-a-package" {
227234
}
228235
```
229236

230-
The _deployment_settings.ocl_ file contains the configuration for the deployment settings associated with the deployment process. If using the default deployment process settings, the .ocl will be mostly empty.
237+
The *deployment_settings.ocl* file contains the configuration for the deployment settings associated with the deployment process. If using the default deployment process settings, the .ocl will be mostly empty.
231238

232239
```hcl
233240
connectivity_policy {
@@ -272,7 +279,7 @@ versioning_strategy {
272279
}
273280
```
274281

275-
The _variables.ocl_ file contains all non-sensitive variables for the project.
282+
The *variables.ocl* file contains all non-sensitive variables for the project.
276283

277284
```hcl
278285
variable "DatabaseName" {
@@ -307,6 +314,7 @@ In Git projects, [Octopus will continue apply variable permissions based on scop
307314
## Slugs in OCL
308315

309316
The following resources will be referenced via their slug:
317+
310318
- Account
311319
- Channel
312320
- Deployment Action
@@ -325,7 +333,7 @@ All other resources will be referenced from OCL via their ID. We plan on growing
325333
When designing the config-as-code feature, we made several decisions to keep an appropriate balance of usability and functionality. There are a few limitations and items of note you should be aware of with config-as-code.
326334

327335
- The Octopus Terraform Provider and OCL are not a 1:1 match. You cannot copy resources between the two and expect everything to work. We want to narrow the gap as much as possible, but as of right now, a gap exists.
328-
- Octopus currently only supports connecting to Git repositories over HTTPS and not SSH.
336+
- Octopus currently only supports connecting to Git repositories over HTTPS and not SSH.
329337
- Shared resources (environments, external feeds, channels, etc.) are referenced by their slug from OCL. The API however will still use IDs.
330338
- Shared resources referenced in OCL that no longer exist in Octopus Server will result in an error when loading through the portal or API. The provided error message should provide information indicating what reference is no longer valid and should be updated or removed before being loaded again.
331339
- Shared resources must exist before loading an OCL file into Octopus Deploy. What that means is if you copy the OCL files from one Git repo to another, and point a new project at those files, then any shared resource must exist before creating that project. That only applies when projects are in different spaces or on different instances. If the resources do not exist, an error message will appear.
@@ -335,4 +343,4 @@ When designing the config-as-code feature, we made several decisions to keep an
335343
## Older versions
336344

337345
- Prior to version 2022.3.4517, Git projects would reference shared resources using their name in OCL. This had a side-effect causing API responses for Git projects to contain names instead of IDs.
338-
From version 2022.3.4517 onwards, a handful of resources are referenced from OCL by their slug. IDs will be used in API responses instead of names.
346+
From version 2022.3.4517 onwards, a handful of resources are referenced from OCL by their slug. IDs will be used in API responses instead of names.

0 commit comments

Comments
 (0)