Skip to content

Commit

Permalink
Support mlflow object versioning (#784)
Browse files Browse the repository at this point in the history
The underlying terraform module supports this, but we didn't add the plumbing to be able to wire it in.
  • Loading branch information
michaeljguarino authored Jul 26, 2023
1 parent 4ab2e1a commit 7dcb3d5
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 7 deletions.
13 changes: 13 additions & 0 deletions mlflow/plural/docs/bucket-versioning.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
## Enable Bucket Versioning

In case you want to enable s3 object versioning, this is supported via a small terraform configuration. Go to `mlflow/terraform/main.tf` and within the manual section of the `aws` module, add:

```tf
module "aws" {
## BEGIN MANUAL SECTION <- be sure to put it w/in these
enable_versioning = true
## END MANUAL SECTION
}
```

Then run a quick `plural deploy --commit "enable mlflow s3 versioning"` and you'll be set.
3 changes: 1 addition & 2 deletions mlflow/terraform/aws/deps.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ apiVersion: plural.sh/v1alpha1
kind: Dependencies
metadata:
description: mlflow aws setup
version: 0.1.4
version: 0.1.5
spec:
breaking: true
dependencies:
- name: aws-bootstrap
repo: bootstrap
Expand Down
11 changes: 6 additions & 5 deletions mlflow/terraform/aws/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@ data "aws_eks_cluster" "cluster" {
}

module "s3_buckets" {
source = "github.com/pluralsh/module-library//terraform/s3-buckets?ref=bucket-protection"
bucket_names = [var.mlflow_bucket]
policy_prefix = var.role_name
force_destroy = var.force_destroy_bucket
bucket_tags = var.bucket_tags
source = "github.com/pluralsh/module-library//terraform/s3-buckets?ref=bucket-protection"
bucket_names = [var.mlflow_bucket]
policy_prefix = var.role_name
force_destroy = var.force_destroy_bucket
bucket_tags = var.bucket_tags
enable_versioning = var.enable_versioning
}

module "assumable_role_mlflow" {
Expand Down
6 changes: 6 additions & 0 deletions mlflow/terraform/aws/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,9 @@ variable "bucket_tags" {
description = "tags to apply to the buckets"
default = {}
}

variable "enable_versioning" {
type = bool
description = "enable s3 object versioning"
default = false
}

0 comments on commit 7dcb3d5

Please sign in to comment.