Skip to content

Commit 7d156b7

Browse files
kunzesesce-taid
authored andcommitted
feat: add the possibility to add extra parameters to the ABFS command
chore: bump terraform-google-iam from 8.1.0 to 8.2.0 PiperOrigin-RevId: 822913301
1 parent 190f3c9 commit 7d156b7

File tree

9 files changed

+39
-3
lines changed

9 files changed

+39
-3
lines changed

examples/simple/iam.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ resource "google_service_account" "client" {
9696

9797
module "project-iam-bindings" {
9898
source = "terraform-google-modules/iam/google//modules/projects_iam"
99-
version = "8.1.0"
99+
version = "8.2.0"
100100

101101
projects = [data.google_project.project.project_id]
102102
mode = "authoritative"

modules/server/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ For example usage, please check the following [example](../../examples/simple/ma
1616
| <a name="input_abfs_bucket_location"></a> [abfs\_bucket\_location](#input\_abfs\_bucket\_location) | The location of the ABFS bucket (https://cloud.google.com/storage/docs/locations). | `string` | n/a | yes |
1717
| <a name="input_abfs_bucket_name"></a> [abfs\_bucket\_name](#input\_abfs\_bucket\_name) | The name of the ABFS bucket. | `string` | `"abfs"` | no |
1818
| <a name="input_abfs_docker_image_uri"></a> [abfs\_docker\_image\_uri](#input\_abfs\_docker\_image\_uri) | Docker image URI for the ABFS server | `string` | n/a | yes |
19+
| <a name="input_abfs_extra_params"></a> [abfs\_extra\_params](#input\_abfs\_extra\_params) | A list of extra parameters to append to the abfs command | `list(string)` | `[]` | no |
1920
| <a name="input_abfs_license"></a> [abfs\_license](#input\_abfs\_license) | ABFS license (JSON) | `string` | n/a | yes |
2021
| <a name="input_abfs_server_allow_stopping_for_update"></a> [abfs\_server\_allow\_stopping\_for\_update](#input\_abfs\_server\_allow\_stopping\_for\_update) | Allow to stop the server to update properties | `bool` | `true` | no |
2122
| <a name="input_abfs_server_cos_image_ref"></a> [abfs\_server\_cos\_image\_ref](#input\_abfs\_server\_cos\_image\_ref) | Reference to the COS boot image to use for the ABFS server | `string` | `"projects/cos-cloud/global/images/family/cos-109-lts"` | no |

modules/server/main.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,8 @@ data "cloudinit_config" "abfs_server" {
141141
--project ${google_spanner_instance.abfs.project} \
142142
--bucket ${data.google_storage_bucket.abfs.name} \
143143
--instance ${google_spanner_instance.abfs.name} \
144-
--db ${google_spanner_database.abfs.name}
144+
--db ${google_spanner_database.abfs.name} \
145+
${join(" ", var.abfs_extra_params)}
145146
EOT
146147
"ABFS_DOCKER_IMAGE_URI" = var.abfs_docker_image_uri,
147148
}

modules/server/metadata.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@ spec:
7272
description: Docker image URI for the ABFS server
7373
varType: string
7474
required: true
75+
- name: abfs_extra_params
76+
description: A list of extra parameters to append to the abfs command
77+
varType: list(string)
78+
defaultValue: []
7579
- name: abfs_bootdisk_size_gb
7680
description: Size in GB for the ABFS bootdisk that will be attached to the VM
7781
varType: number

modules/server/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,12 @@ variable "abfs_bootdisk_type" {
8484
default = "pd-ssd"
8585
}
8686

87+
variable "abfs_extra_params" {
88+
type = list(string)
89+
description = "A list of extra parameters to append to the abfs command"
90+
default = []
91+
}
92+
8793
// Google Cloud Storage
8894
variable "existing_bucket_name" {
8995
type = string

modules/uploaders/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,13 @@ For example usage, please check the following [example](../../examples/simple/ma
1414
| <a name="input_abfs_datadisk_mountpoint"></a> [abfs\_datadisk\_mountpoint](#input\_abfs\_datadisk\_mountpoint) | Location for mounting the ABFS datadisk on the host VM | `string` | `"/mnt/disks/abfs-data"` | no |
1515
| <a name="input_abfs_docker_image_uri"></a> [abfs\_docker\_image\_uri](#input\_abfs\_docker\_image\_uri) | Docker image URI for the ABFS uploader | `string` | n/a | yes |
1616
| <a name="input_abfs_enable_git_lfs"></a> [abfs\_enable\_git\_lfs](#input\_abfs\_enable\_git\_lfs) | Enable Git LFS support | `bool` | `false` | no |
17+
| <a name="input_abfs_extra_params"></a> [abfs\_extra\_params](#input\_abfs\_extra\_params) | A list of extra parameters to append to the abfs command | `list(string)` | `[]` | no |
1718
| <a name="input_abfs_gerrit_uploader_allow_stopping_for_update"></a> [abfs\_gerrit\_uploader\_allow\_stopping\_for\_update](#input\_abfs\_gerrit\_uploader\_allow\_stopping\_for\_update) | Allow to stop uploaders to update properties | `bool` | `true` | no |
1819
| <a name="input_abfs_gerrit_uploader_count"></a> [abfs\_gerrit\_uploader\_count](#input\_abfs\_gerrit\_uploader\_count) | The number of gerrit uploader instances to create | `number` | `3` | no |
1920
| <a name="input_abfs_gerrit_uploader_datadisk_name_prefix"></a> [abfs\_gerrit\_uploader\_datadisk\_name\_prefix](#input\_abfs\_gerrit\_uploader\_datadisk\_name\_prefix) | A name prefix for the ABFS gerrit uploader datadisk(s) that will be attached to VM(s). Note, this does not affect the mounting of the disk - the device name is always set to "abfs-server-storage" | `string` | `"abfs-gerrit-uploader-datadisk"` | no |
2021
| <a name="input_abfs_gerrit_uploader_datadisk_size_gb"></a> [abfs\_gerrit\_uploader\_datadisk\_size\_gb](#input\_abfs\_gerrit\_uploader\_datadisk\_size\_gb) | Size in GB for the ABFS gerrit uploader datadisk(s) that will be attached to the VM(s) | `number` | `4096` | no |
2122
| <a name="input_abfs_gerrit_uploader_datadisk_type"></a> [abfs\_gerrit\_uploader\_datadisk\_type](#input\_abfs\_gerrit\_uploader\_datadisk\_type) | The PD regional disk type to use for the ABFS gerrit uploader datadisk(s) | `string` | `"pd-ssd"` | no |
23+
| <a name="input_abfs_gerrit_uploader_extra_params"></a> [abfs\_gerrit\_uploader\_extra\_params](#input\_abfs\_gerrit\_uploader\_extra\_params) | A list of extra parameters to append to the gerrit upload-daemon sub-command | `list(string)` | `[]` | no |
2224
| <a name="input_abfs_gerrit_uploader_git_branch"></a> [abfs\_gerrit\_uploader\_git\_branch](#input\_abfs\_gerrit\_uploader\_git\_branch) | Branches from where to find projects (e.g. ["main","v-keystone-qcom-release"]) (default ["main"]) | `set(string)` | <pre>[<br/> "main"<br/>]</pre> | no |
2325
| <a name="input_abfs_gerrit_uploader_machine_type"></a> [abfs\_gerrit\_uploader\_machine\_type](#input\_abfs\_gerrit\_uploader\_machine\_type) | Machine type for ABFS gerrit uploaders | `string` | `"n2d-standard-48"` | no |
2426
| <a name="input_abfs_gerrit_uploader_manifest_server"></a> [abfs\_gerrit\_uploader\_manifest\_server](#input\_abfs\_gerrit\_uploader\_manifest\_server) | The manifest server to assume | `string` | `"android.googlesource.com"` | no |

modules/uploaders/main.tf

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,10 +179,12 @@ data "cloudinit_config" "abfs_gerrit_uploader_configs" {
179179
--remote-servers ${var.abfs_server_name}:50051 \
180180
--manifest-project-name ${var.abfs_manifest_project_name} \
181181
--lfs=${var.abfs_enable_git_lfs} \
182+
${join(" ", var.abfs_extra_params)} \
182183
gerrit upload-daemon ${var.abfs_gerrit_uploader_count} ${count.index} \
183184
--branch ${join(",", var.abfs_gerrit_uploader_git_branch)} \
184185
--project-storage-path /abfs-storage \
185-
--manifest-file ${var.abfs_manifest_file}
186+
--manifest-file ${var.abfs_manifest_file} \
187+
${join(" ", var.abfs_gerrit_uploader_extra_params)}
186188
EOT
187189
"ABFS_DOCKER_IMAGE_URI" = var.abfs_docker_image_uri,
188190
"DATADISK_MOUNTPOINT" = var.abfs_datadisk_mountpoint,

modules/uploaders/metadata.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,14 @@ spec:
8585
varType: set(string)
8686
defaultValue:
8787
- main
88+
- name: abfs_extra_params
89+
description: A list of extra parameters to append to the abfs command
90+
varType: list(string)
91+
defaultValue: []
92+
- name: abfs_gerrit_uploader_extra_params
93+
description: A list of extra parameters to append to the gerrit upload-daemon sub-command
94+
varType: list(string)
95+
defaultValue: []
8896
- name: abfs_enable_git_lfs
8997
description: Enable Git LFS support
9098
varType: bool

modules/uploaders/variables.tf

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,18 @@ variable "abfs_gerrit_uploader_git_branch" {
8686
default = ["main"]
8787
}
8888

89+
variable "abfs_extra_params" {
90+
type = list(string)
91+
description = "A list of extra parameters to append to the abfs command"
92+
default = []
93+
}
94+
95+
variable "abfs_gerrit_uploader_extra_params" {
96+
type = list(string)
97+
description = "A list of extra parameters to append to the gerrit upload-daemon sub-command"
98+
default = []
99+
}
100+
89101
variable "abfs_enable_git_lfs" {
90102
type = bool
91103
description = "Enable Git LFS support"

0 commit comments

Comments
 (0)