Skip to content

Commit 96d6392

Browse files
author
Matthew Fisher
authored
Merge pull request #492 from jeroenvisser101/cache-docs
docs(slugbuilder-cache): add docs for the slugbuilder cache
2 parents 924457a + 1f09a8c commit 96d6392

3 files changed

Lines changed: 31 additions & 2 deletions

File tree

src/applications/deploying-apps.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ It is possible to configure a few of the [globally tunable](../applications/mana
6060

6161
Setting | Description
6262
----------------------------------------------- | ---------------------------------
63+
DEIS_DISABLE_CACHE | if set, this will disable the [slugbuilder cache][] (default: not set)
6364
DEIS_DEPLOY_BATCHES | the number of pods to bring up and take down sequentially during a scale (default: number of available nodes)
6465
DEIS_DEPLOY_TIMEOUT | deploy timeout in seconds per deploy batch (default: 120)
6566
IMAGE_PULL_POLICY | the kubernetes [image pull policy][pull-policy] for application images (default: "IfNotPresent") (allowed values: "Always", "IfNotPresent")
@@ -100,6 +101,7 @@ each having multiple ReplicaSets (one per release) which in turn manage the Pods
100101
Deis Workflow will behave the same way with `DEIS_KUBERNETES_DEPLOYMENTS` enabled or disabled (only applicable to versions prior to 2.4).
101102
The changes are behind the scenes. Where you will see differences while using the CLI is `deis ps:list` will output Pod names differently.
102103

104+
[slugbuilder cache]: ./managing-app-configuration.md#slugbuilder-cache
103105
[install client]: ../users/cli.md#installation
104106
[application]: ../reference-guide/terms.md#application
105107
[controller]: ../understanding-workflow/components.md#controller

src/applications/managing-app-configuration.md

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,32 @@ the application to an external PostgreSQL database.
5252
Detachments can be performed with `deis config:unset`.
5353

5454

55+
## Slugbuilder Cache
56+
57+
By default, apps using the [Slugbuilder][] will have caching turned on. This means that Deis will
58+
persist all data being written to `CACHE_DIR` inside the buildpack will be persisted between
59+
deploys. When deploying applications that depend on third-party libraries that have to be fetched,
60+
this could speed up deployments a lot. In order to make use of this, the buildpack must implement
61+
the cache by writing to the cache directory. Most buildpacks already implement this, but when using
62+
custom buildpacks, it might need to be changed to make full use of the cache.
63+
64+
### Disabling and re-enabling the cache
65+
66+
In some cases, cache might not speed up your application. To disable caching, you can set the
67+
`DEIS_DISABLE_CACHE` variable with `deis config:set DEIS_DISABLE_CACHE=1`. When you disable the
68+
cache, Deis will clear up files it created to store the cache. After having it turned off, run
69+
`deis config:unset DEIS_DISABLE_CACHE` to re-enable the cache.
70+
71+
### Clearing the cache
72+
73+
Use the following procedure to clear the cache:
74+
75+
$ deis config:set DEIS_DISABLE_CACHE=1
76+
$ git commit --allow-empty -m "Clearing Deis cache"
77+
$ git push deis # (if you use a different remote, you should use your remote name)
78+
$ deis config:unset DEIS_DISABLE_CACHE
79+
80+
5581
## Custom Health Checks
5682

5783
By default, Workflow only checks that the application starts in their Container. If it is preferred
@@ -179,7 +205,7 @@ TCP Socket Probe: N/A
179205
Configured health checks also modify the default application deploy behavior. When starting a new
180206
Pod, Workflow will wait for the health check to pass before moving onto the next Pod.
181207

182-
208+
[Slugbuilder]: ../understanding-workflow/components.md#builder-builder-slugbuilder-and-dockerbuilder
183209
[attached resources]: http://12factor.net/backing-services
184210
[stores config in environment variables]: http://12factor.net/config
185211
[release]: ../reference-guide/terms.md#release

src/installing-workflow/configuring-object-storage.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,8 @@ Slugbuilder is configured and launched by the builder component. Slugbuilder rea
115115
If you are using slugbuilder as a standalone component the following configuration is important:
116116

117117
- `TAR_PATH` - The location of the application `.tar` archive, relative to the configured bucket for builder e.g. `home/burley-yeomanry:git-3865c987/tar`
118-
- `PUT_PATH` - The location to upload the finished slug, relative to the configured bucket fof builder e.g. `home/burley-yeomanry:git-3865c987/push`
118+
- `PUT_PATH` - The location to upload the finished slug, relative to the configured bucket of builder e.g. `home/burley-yeomanry:git-3865c987/push`
119+
- `CACHE_PATH` - The location to upload the cache, relative to the configured bucket of builder e.g. `home/burley-yeomanry/cache`
119120

120121
!!! note
121122
These environment variables are case-sensitive.

0 commit comments

Comments
 (0)