Skip to content

Commit f39409b

Browse files
Upgrade to Ubuntu 22.04, and custom 6.1.0-rc5 kernel
Change-Id: I7f49901478ed0085710e7df574d3b24132cd4b42
1 parent 2e9a362 commit f39409b

File tree

29 files changed

+128
-1206
lines changed

29 files changed

+128
-1206
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
*.pkrvars.json
2020
*.auto.pkrvars.json
2121

22+
# Exclude Specific Packer Variables File
23+
!image/internal-build/image.pkrvars.hcl
24+
2225
# Service Account
2326
service-account-key.json
2427

deployment/README.md

Lines changed: 2 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ This directory contains a [Terraform Module](https://www.terraform.io/docs/modul
55
The `main` branch may be updated at any time with the latest changes which could be breaking. You should always configure your module to use a release. This can be configured in the modules Terraform Configuration block.
66

77
```
8-
source = "github.com/GoogleCloudPlatform/knfsd-cache-utils//deployment/terraform-module-knfsd?ref=v0.10.0"
8+
source = "github.com/GoogleCloudPlatform/knfsd-cache-utils//deployment/terraform-module-knfsd?ref=v1.0.0-beta1"
99
```
1010

1111
## Prerequisites
@@ -28,7 +28,7 @@ Basic usage of this module is as follows:
2828
```terraform
2929
module "nfs_proxy" {
3030
31-
source = "github.com/GoogleCloudPlatform/knfsd-cache-utils//deployment/terraform-module-knfsd?ref=v0.10.0"
31+
source = "github.com/GoogleCloudPlatform/knfsd-cache-utils//deployment/terraform-module-knfsd?ref=v1.0.0-beta1"
3232
3333
# Google Cloud Project Configuration
3434
PROJECT = "my-gcp-project"
@@ -182,26 +182,6 @@ The service account will need the following project level IAM permissions:
182182
| LOCAL_SSDS | (Only used if `CACHEFILESD_DISK_TYPE` = `local-ssd`) The number of Local SSDs to assign to each cache instance. This can be either 0 to 8, 16, or 24 local SSDs for up to 9TB of capacity ([see here](https://cloud.google.com/compute/docs/disks/local-ssd#choosing_a_valid_number_of_local_ssds)). If you are setting this to 24 Local SSDs you should also change the `MACHINE_TYPE` variable to an instance with 32 CPU's, for example `n1-highmem-32`. | False | `4` |
183183
| CACHEFILESD_PERSISTENT_DISK_SIZE_GB | (Only used if `CACHEFILESD_DISK_TYPE` = `pd-standard`, `pd-balanced` or `pd-ssd`), what size should the persistent disk be in GB? Can be set between `100` and `64000`. For large volumes, consider larger instance types (see [here](https://cloud.google.com/compute/docs/disks/performance)). | False | `1500` |
184184

185-
### Culling Options
186-
187-
| Variable | Description | Required | Default |
188-
| -------------------- | ------------------------------------------------------------------------------------------------------------ | -------- | ------------------------------------------------------------------------------------------ |
189-
| CULLING | Culling method to use (`default`, `custom`, or `none`). | False | `custom` |
190-
| CULLING_LAST_ACCESS | (custom only) Remove files from the cache that were last accessed over `CULLING_LAST_ACCESS` ago. | False | If using Local SSD: 1 hour for each `LOCAL_SSD`.<br><br>If using Persistent Disk, 6 hours. |
191-
| CULLING_THRESHOLD | (custom only) Cull when the percentage of remaining disk space (or inodes) is less than `CULLING_THRESHOLD`. | False | `20` |
192-
| CULLING_INTERVAL | (custom only) How often to check if the remaining disk space is less than the `CULLING_THRESHOLD` | False | `1m` |
193-
| CULLING_QUIET_PERIOD | (custom only) After culling, how long to wait before resuming checks. | False | `CULLING_LAST_ACCESS / 4` |
194-
195-
The culling `CULLING` mode supports the following options:
196-
197-
* `default` - This uses the standard cachefilesd to perform culling.
198-
* `custom` - This uses the custom knfsd-cull service to perform culling.
199-
* `none` - Disables culling completely
200-
201-
The purpose of the custom culling agent is to workaround a known issue where cachefilesd may stop culling files in the cache. See [culling](../docs/culling.md) for more information on how to configure cachefilesd, and the known issue where cachefilesd may stop culling.
202-
203-
The `none` option supports special cases where the cache rarely fills up.
204-
205185
### Mount Options
206186

207187
These mount options are for the proxy to the source server.
@@ -232,51 +212,6 @@ These mount options are for the proxy to the source server.
232212
| NOHIDE | When `true`, adds the `nohide` option to all the exports. | False | `true` |
233213
| EXPORT_OPTIONS | Any custom NFS exports options. These options will be applied to all NFS exports. | False | `""` |
234214

235-
#### Custom culling options
236-
237-
The durations, `CULLING_LAST_ACCESS`, `CULLING_INTERVAL`, and
238-
`CULLING_QUIET_PERIOD` support `h`, `m`, and `s` (hours, minutes, seconds)
239-
For example `5m`, `2.5h`, or `1h30m`.
240-
241-
To avoid deleting files unnecessarily the culling process will wait until the
242-
remaining percentage of free space is less than `CULLING_THRESHOLD`. The
243-
remaining free space will be checked every `CULLING_INTERVAL`.
244-
245-
Any file with a last access time older than `CULLING_LAST_ACCESS` will be
246-
deleted. Because files are deleted based on their last access, this might not
247-
remove enough files (or any files) to bring the free space above the threshold
248-
if most of the files in the cache have been used within the last access period.
249-
It can also remove more files than required (possibly even all the files).
250-
251-
Once a culling attempt has been completed (even if no files were culled),
252-
culling will wait for `CULLING_QUIET_PERIOD` before resuming culling checks.
253-
This avoids repeatedly scanning the full file tree (costing IOPS) while most
254-
files are in use.
255-
256-
**IMPORTANT:** `CULLING_THRESHOLD` *MUST* be greater than `bstop` and `fstop` in
257-
`/etc/cachefilesd.conf`. Otherwise cachefilesd will stop caching data before the
258-
custom culling threshold is reached so culling will never run.
259-
260-
#### Example
261-
262-
```terraform
263-
CULLING = "custom"
264-
CULLING_LAST_ACCESS = "4h"
265-
CULLING_THRESHOLD = 20
266-
CULLING_INTERVAL = "1m"
267-
CULLING_QUIET_PERIOD = "1h"
268-
```
269-
270-
The culling agent will check every minute (`CULLING_INTERVAL`) to see if the
271-
remaining disk space (or inodes) is less than 20% (`CULLING_THRESHOLD`) of the
272-
total disk space.
273-
274-
When the remaining disk space is below the 20% threshold the culling agent will
275-
then remove any files that were last accessed over four hours ago (`CULLING_LAST_ACCESS`)
276-
from the cache.
277-
278-
The culling agent will then wait for at least one hour (`CULLING_QUIET_PERIOD`)
279-
before resuming culling checks.
280215

281216
### Autoscaling Configuration
282217

deployment/fanout.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ There is no special logic in the Knfsd Terraform Module to handle the fanout arc
3737
```terraform
3838
module "nfs_proxy_fanout" {
3939
40-
source = "github.com/GoogleCloudPlatform/knfsd-cache-utils//deployment/terraform-module-knfsd?ref=v0.10.0"
40+
source = "github.com/GoogleCloudPlatform/knfsd-cache-utils//deployment/terraform-module-knfsd?ref=v1.0.0-beta1"
4141
4242
# Google Cloud Project Configuration
4343
PROJECT = "my-gcp-project"
@@ -67,7 +67,7 @@ module "nfs_proxy_fanout" {
6767
6868
module "nfs_proxy_cluster" {
6969
70-
source = "github.com/GoogleCloudPlatform/knfsd-cache-utils//deployment/terraform-module-knfsd?ref=v0.10.0"
70+
source = "github.com/GoogleCloudPlatform/knfsd-cache-utils//deployment/terraform-module-knfsd?ref=v1.0.0-beta1"
7171
7272
# Google Cloud Project Configuration
7373
PROJECT = "my-gcp-project"

deployment/metrics.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ Providing the metrics config from a file:
5959

6060
```terraform
6161
module "nfs_proxy" {
62-
source = "github.com/GoogleCloudPlatform/knfsd-cache-utils//deployment/terraform-module-knfsd?ref=v0.10.0"
62+
source = "github.com/GoogleCloudPlatform/knfsd-cache-utils//deployment/terraform-module-knfsd?ref=v1.0.0-beta1"
6363
6464
METRICS_AGENT_CONFIG = file("metrics-config.yaml")
6565
}
@@ -69,7 +69,7 @@ Providing the metrics config inline using heredoc syntax:
6969

7070
```terraform
7171
module "nfs_proxy" {
72-
source = "github.com/GoogleCloudPlatform/knfsd-cache-utils//deployment/terraform-module-knfsd?ref=v0.10.0"
72+
source = "github.com/GoogleCloudPlatform/knfsd-cache-utils//deployment/terraform-module-knfsd?ref=v1.0.0-beta1"
7373
7474
METRICS_AGENT_CONFIG = <<-EOT
7575
receivers:

deployment/terraform-module-knfsd/compute.tf

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -108,13 +108,6 @@ resource "google_compute_instance_template" "nfsproxy-template" {
108108
EXPORT_OPTIONS = var.EXPORT_OPTIONS
109109
NFS_MOUNT_VERSION = var.NFS_MOUNT_VERSION
110110

111-
CULLING = var.CULLING
112-
113-
CULLING_LAST_ACCESS = coalesce(var.CULLING_LAST_ACCESS, local.CULLING_LAST_ACCESS_DEFAULT)
114-
CULLING_THRESHOLD = var.CULLING_THRESHOLD
115-
CULLING_INTERVAL = var.CULLING_INTERVAL
116-
CULLING_QUIET_PERIOD = var.CULLING_QUIET_PERIOD
117-
118111
# system
119112
NFS_KERNEL_SERVER_CONF = file("${path.module}/resources/nfs-kernel-server.conf")
120113
NUM_NFS_THREADS = var.NUM_NFS_THREADS

deployment/terraform-module-knfsd/resources/proxy-startup.sh

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -216,12 +216,6 @@ function init() {
216216
DISABLED_NFS_VERSIONS=$(get_attribute DISABLED_NFS_VERSIONS)
217217
READ_AHEAD_KB=$(get_attribute READ_AHEAD_KB)
218218

219-
CULLING="$(get_attribute CULLING)"
220-
CULLING_LAST_ACCESS="$(get_attribute CULLING_LAST_ACCESS)"
221-
CULLING_THRESHOLD="$(get_attribute CULLING_THRESHOLD)"
222-
CULLING_INTERVAL="$(get_attribute CULLING_INTERVAL)"
223-
CULLING_QUIET_PERIOD="$(get_attribute CULLING_QUIET_PERIOD)"
224-
225219
ENABLE_STACKDRIVER_METRICS=$(get_attribute ENABLE_STACKDRIVER_METRICS)
226220
METRICS_AGENT_CONFIG=$(get_attribute METRICS_AGENT_CONFIG)
227221
ENABLE_KNFSD_AGENT=$(get_attribute ENABLE_KNFSD_AGENT)
@@ -445,34 +439,6 @@ function configure-nfs() {
445439

446440
}
447441

448-
function configure-culling() (
449-
function fmt() {
450-
if [[ -n "$2" ]]; then
451-
printf '%s %s\n' "$1" "$2"
452-
fi
453-
}
454-
455-
sed -i '/^nocull/d' /etc/cachefilesd.conf
456-
457-
if [[ "$CULLING" == "none" ]] || [[ "$CULLING" == "custom" ]]; then
458-
echo "nocull" >>/etc/cachefilesd.conf
459-
fi
460-
461-
if [[ "$CULLING" == "custom" ]]; then
462-
: >/etc/knfsd-cull.conf
463-
fmt last-access "$CULLING_LAST_ACCESS" >>/etc/knfsd-cull.conf
464-
fmt threshold "$CULLING_THRESHOLD" >>/etc/knfsd-cull.conf
465-
fmt interval "$CULLING_INTERVAL" >>/etc/knfsd-cull.conf
466-
fmt quiet-period "$CULLING_QUIET_PERIOD" >>/etc/knfsd-cull.conf
467-
468-
echo "Starting Custom Culling Agent..."
469-
start-services knfsd-cull
470-
echo "Finished starting Custom Culling Agent."
471-
else
472-
echo "Custom Culling Agent disabled. Skipping..."
473-
fi
474-
)
475-
476442
function configure-metrics() {
477443

478444
# If needed, override the Monitoring API to use an IP address from private.googleapis.com
@@ -552,7 +518,6 @@ function main() {
552518

553519
configure-read-ahead
554520
configure-nfs
555-
configure-culling
556521
configure-metrics
557522

558523
start-nfs

deployment/terraform-module-knfsd/resources/tests/configure-culling.bats

Lines changed: 0 additions & 91 deletions
This file was deleted.

deployment/terraform-module-knfsd/resources/tests/expected/configure-culling/culling-custom-creates-config

Lines changed: 0 additions & 4 deletions
This file was deleted.

deployment/terraform-module-knfsd/resources/tests/expected/configure-culling/culling-default-quiet-period

Lines changed: 0 additions & 3 deletions
This file was deleted.

deployment/terraform-module-knfsd/variables.tf

Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -331,59 +331,6 @@ variable "NETAPP_ALLOW_COMMON_NAME" {
331331
default = false
332332
}
333333

334-
variable "CULLING" {
335-
type = string
336-
default = "default"
337-
338-
validation {
339-
condition = contains(["default", "custom", "none"], var.CULLING)
340-
error_message = "CULLING must be one of [default, custom, none]."
341-
}
342-
}
343-
344-
variable "CULLING_LAST_ACCESS" {
345-
type = string
346-
default = "" # calculate default based on LOCAL_SSDS
347-
348-
validation {
349-
# This will also match the empty string, but in this case the empty string is allowed.
350-
condition = can(regex("^(\\d+h)?(\\d+m)?(\\d+s)?$", var.CULLING_LAST_ACCESS))
351-
error_message = "CULLING_LAST_ACCESS must be a positive duration, e.g. '1h'. Valid time units are 'h' (hours), 'm' (minutes), 's' (seconds)."
352-
}
353-
}
354-
355-
variable "CULLING_THRESHOLD" {
356-
type = number
357-
default = 20
358-
359-
validation {
360-
condition = var.CULLING_THRESHOLD == null || (var.CULLING_THRESHOLD >= 0 && var.CULLING_THRESHOLD <= 100)
361-
error_message = "CULLING_THRESHOLD must between 0% and 100%."
362-
}
363-
}
364-
365-
variable "CULLING_INTERVAL" {
366-
type = string
367-
default = "1m"
368-
369-
validation {
370-
# This will also match the empty string, but in this case the empty string is allowed.
371-
condition = can(regex("^(\\d+h)?(\\d+m)?(\\d+s)?$", var.CULLING_INTERVAL))
372-
error_message = "CULLING_INTERVAL must be a positive duration, e.g. '1h'. Valid time units are 'h' (hours), 'm' (minutes), 's' (seconds)."
373-
}
374-
}
375-
376-
variable "CULLING_QUIET_PERIOD" {
377-
type = string
378-
default = ""
379-
380-
validation {
381-
# This will also match the empty string, but in this case the empty string is allowed.
382-
condition = can(regex("^(\\d+h)?(\\d+m)?(\\d+s)?$", var.CULLING_QUIET_PERIOD))
383-
error_message = "CULLING_QUIET_PERIOD must be a positive duration, e.g. '1h'. Valid time units are 'h' (hours), 'm' (minutes), 's' (seconds)."
384-
}
385-
}
386-
387334
variable "CACHEFILESD_DISK_TYPE" {
388335
type = string
389336
default = "local-ssd"

0 commit comments

Comments
 (0)