Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix error when accessing prefect graphql installed on a local minikube #99

Merged
merged 3 commits into from
Nov 5, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,13 @@ module "prefect-server" {
namespace = kubernetes_namespace.prefect_namespace.metadata[0].name

parent_module_name = basename(abspath(path.module))
hostname = var.hostname
protocol = var.protocol
service_type = var.prefect_service_type
agent_prefect_labels = var.prefect_agent_labels
service_account_name = var.prefect_service_account_name
seldon_manager_cluster_role_name = var.install_seldon ? "seldon-manager-role-${var.seldon_namespace}" : ""
feast_spark_operator_cluster_role_name = var.install_feast ? var.feast_spark_operator_cluster_role_name : ""
create_tenant_enabled = var.prefect_create_tenant_enabled
graphql_url = var.install_locally ? "http://localhost:4200/graphql" : "${var.protocol}://prefect.${var.hostname}/graphql/"
}


Expand Down
2 changes: 1 addition & 1 deletion modules/prefect-server/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ resource "helm_release" "prefect-server" {

set {
name = "ui.apolloApiUrl"
value = "${var.protocol}://prefect.${var.hostname}/graphql/"
value = var.graphql_url
}

set {
Expand Down
8 changes: 2 additions & 6 deletions modules/prefect-server/variables.tf
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
variable "hostname" {
description = "Application hostname ex.: mlops.mywebsite.com"
}

variable "protocol" {
description = "Preferred connection protocol"
variable "graphql_url" {
description = "URL to Apollo GraphQL"
}

variable "parent_module_name" {
Expand Down
11 changes: 9 additions & 2 deletions tutorials/set-up-minikube-cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,15 @@ jhub_proxy_secret_token = "IfYouDecideToUseJhubProxyYouShouldChangeThisValueToAR
enable_ory_authentication = false
oauth2_providers = []
mlflow_artifact_root = "/tmp"
install_locally = true
```

## Step 4: Initialising Terraform

Run the following in your shell to set your Kubectl config.

```
export KUBE_CONFIG_PATH=~./kube/config
export KUBE_CONFIG_PATH=~/.kube/config
```

Now change into the `OpenMLOps` directory and run `terraform init`, which will pull down the terraform dependencies that you need.
Expand Down Expand Up @@ -99,7 +100,13 @@ prefect backend server && prefect server create-tenant --name default --slug def

## Trying out the services

The first step is to look at the service addresses and ports available. Run the command
You can keep the port forward from the previous step running. Or run:

```
kubectl port-forward -n prefect svc/prefect-server-apollo 4200
```

Then, look at the service addresses and ports available. Run the command:

```
kubectl get services --all-namespaces
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,25 @@ Next you'll need to personalise the secrets and other values in the `openmlops/O

## Initialising Terraform

Now change into the `OpenMLOps-AWS` directory and run `terraform init`, which will pull down the terraform dependencies that you need.
### Creating an S3 bucket to store Terraform state

If you don't have an S3 bucket to store Terraform state files, you can create a new one by running:

```
aws s3api create-bucket --bucket YOUR_BUCKET_NAME --region YOUR_REGION
```

### Initialising Terraform with the s3 backend

Now change into the `OpenMLOps-AWS` directory and create `backend-config.txt` file with the bucket name:

```
bucket = "YOUR_BUCKET_NAME"
key = "open-mlops.tfstate"
region = "YOUR_REGION"
```

Then, run `terraform init -backend-config=backend-config.txt`, which will pull down the terraform dependencies that you need.

You should see "Terraform has been successfully initialized!" towards the end of the output.

Expand Down
5 changes: 5 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ variable "protocol" {
description = "Preferred connection protocol. If using https, a valid ACM certificate must be provided under tls_certificate_arn. See documentation"
}

variable "install_locally" {
default = false
description = "Whether to install on a local minikube"
}

## MLFlow

variable "mlflow_namespace" {
Expand Down