Skip to content
This repository has been archived by the owner on May 4, 2021. It is now read-only.

Commit

Permalink
Change default cache TTL from 1 week to 2 weeks (#333)
Browse files Browse the repository at this point in the history
* Change default cache TTL from 1 week to 2 weeks

* Update doc

* More fixes

* Run mkdocs

* Fix

* Fix
  • Loading branch information
Yiran Wang authored May 6, 2020
1 parent d71582a commit 4bd92f7
Show file tree
Hide file tree
Showing 7 changed files with 150 additions and 138 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ Makisu caches docker image layers both locally and in docker registry (if --push
For example, Redis can be setup as a distributed cache key-value store with this [Kubernetes job spec](examples/k8s/redis.yaml).
Then connect Makisu to redis cache by passing `--redis-cache-addr=redis:6379` argument.
If the Redis server is password-protected, use `--redis-cache-password=password` argument.
Cache has a 7 day TTL by default, which can be configured with `--local-cache-ttl=7d` argument.
Cache has a 14 day TTL by default, which can be configured with `--local-cache-ttl=14d` argument.

For more options on cache, please see [Cache](docs/CACHE.md).

Expand Down
4 changes: 2 additions & 2 deletions bin/makisu/cmd/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,10 @@ func getBuildCmd() *buildCmd {
buildCmd.PersistentFlags().StringVar(&buildCmd.commit, "commit", "implicit", "Set to explicit to only commit at steps with '#!COMMIT' annotations; Set to implicit to commit at every ADD/COPY/RUN step")
buildCmd.PersistentFlags().StringArrayVar(&buildCmd.blacklists, "blacklist", nil, "Makisu will ignore all changes to these locations in the resulting docker images")

buildCmd.PersistentFlags().DurationVar(&buildCmd.localCacheTTL, "local-cache-ttl", time.Hour*168, "Time-To-Live for local cache")
buildCmd.PersistentFlags().DurationVar(&buildCmd.localCacheTTL, "local-cache-ttl", time.Hour*336, "Time-To-Live for local cache")
buildCmd.PersistentFlags().StringVar(&buildCmd.redisCacheAddress, "redis-cache-addr", "", "The address of a redis server for cacheID to layer sha mapping")
buildCmd.PersistentFlags().StringVar(&buildCmd.redisCachePassword, "redis-cache-password", "", "The password of the Redis server, should match 'requirepass' in redis.conf")
buildCmd.PersistentFlags().DurationVar(&buildCmd.redisCacheTTL, "redis-cache-ttl", time.Hour*168, "Time-To-Live for redis cache")
buildCmd.PersistentFlags().DurationVar(&buildCmd.redisCacheTTL, "redis-cache-ttl", time.Hour*336, "Time-To-Live for redis cache")
buildCmd.PersistentFlags().StringVar(&buildCmd.httpCacheAddress, "http-cache-addr", "", "The address of the http server for cacheID to layer sha mapping")
buildCmd.PersistentFlags().StringArrayVar(&buildCmd.httpCacheHeaders, "http-cache-header", nil, "Request header for http cache server. Format is \"--http-cache-header <header>:<value>\"")

Expand Down
4 changes: 2 additions & 2 deletions docs/CACHE.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ local file cache, redis based distributed cache, and generic HTTP based distribu
If no cache options are provided, local file cache is used by default.
To configure local file cache TTL:
```
--local-cache-ttl duration Time-To-Live for local cache (default 168h0m0s)
--local-cache-ttl duration Time-To-Live for local cache (default 336h0m0s)
```
To disable it, set ttl to 0s.

Expand All @@ -22,7 +22,7 @@ To configure redis cache, use the following options:
```
--redis-cache-addr string The address of a redis server for cacheID to layer sha mapping
--redis-cache-password string The password of the Redis server, should match 'requirepass' in redis.conf
--redis-cache-ttl duration Time-To-Live for redis cache (default 168h0m0s)
--redis-cache-ttl duration Time-To-Live for redis cache (default 336h0m0s)
```

## HTTP cache
Expand Down
6 changes: 3 additions & 3 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ Makisu caches docker image layers both locally and in docker registry (if --push
For example, Redis can be setup as a distributed cache key-value store with this [Kubernetes job spec](examples/k8s/redis.yaml).
Then connect Makisu to redis cache by passing `--redis-cache-addr=redis:6379` argument.
If the Redis server is password-protected, use `--redis-cache-password=password` argument.
Cache has a 7 day TTL by default, which can be configured with `--local-cache-ttl=7d` argument.
Cache has a 14 day TTL by default, which can be configured with `--local-cache-ttl=14d` argument.

For more options on cache, please see [Cache](CACHE.md).

Expand Down Expand Up @@ -182,7 +182,7 @@ It works very well with a subset of Docker build scenarios given a Bazel build f
### Kaniko

Kaniko provides good compatibility with Docker and executes build commands in userspace without the need for Docker daemon, although it must still run inside a container. Kaniko offers smooth integration with Kubernetes, making it a competent tool for Kubernetes users.
On the other hand, Makisu has some performance tweaks for large images (especially those with node_modules), allows cache to expire, and offers more control over cache generation through #!COMMIT, make it optimal for complex workflows.
On the other hand, Makisu has some performance tweaks for large images with multi-phase builds by avoiding unnecessary disk scans, and offers more control over cache generation and layer size through #!COMMIT, make it optimal for complex workflows.

### BuildKit / img

Expand All @@ -195,4 +195,4 @@ Please check out our [guide](CONTRIBUTING.md).

# Contact

To contact us, please join our [Slack channel](https://join.slack.com/t/uber-container-tools/shared_invite/enQtNTIxODAwMDEzNjM1LWIyNzUyMTk3NTAzZGY0MDkzMzQ1YTlmMTUwZmIwNDk3YTA0ZjZjZGRhMTM2NzI0OGM3OGNjMDZiZTI2ZTY5NWY).
To contact us, please join our [Slack channel](https://join.slack.com/t/uber-container-tools/shared_invite/enQtNTIxODAwMDEzNjM1LWIwYzIxNmUwOGY3MmVmM2MxYTczOTQ4ZDU0YjAxMTA0NDgyNzdlZTA4ZWVkZGNlMDUzZDA1ZTJiZTQ4ZDY0YTM).
Loading

0 comments on commit 4bd92f7

Please sign in to comment.