Skip to content

Commit

Permalink
minor fix for kubernetes plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
mpvgithub committed Jan 18, 2024
1 parent da9b1b6 commit 8330a1e
Show file tree
Hide file tree
Showing 14 changed files with 25 additions and 44 deletions.
11 changes: 5 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,8 @@ ipython_config.py
# Coverage
.coverage

infra/.terraform/*
infra/*.tfstate*
infra/cluster_autoscaler.yml
infra/.terraform.lock.hcl
infra/covalent-eks-cluster_config
infra/.tfvars
.terraform
*.tfstate*
*.terraform.lock.hcl
covalent-eks-cluster_config
*.tfvars
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [UNRELEASED]

## Changed

- Changed the folder structure for the terraform files matching standard plugin folder format
- Minor code changes to kubernetes yml files

## [0.2.0] - 2023-09-20

### Changed
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ all:
@echo "To tear down infrastructure, use 'make clean'."

deploy:
(cd infra && bash ./deploy-eks.sh)
(cd covalent_kubernetes_plugin/assets/infra && bash ./deploy-eks.sh)

clean:
(cd infra && terraform destroy -auto-approve -state $(HOME)/.cache/covalent/terraform.tfstate)
rm -f infra/cluster_autoscaler.yml
(cd covalent_kubernetes_plugin/assets/infra && terraform destroy -auto-approve -state $(HOME)/.cache/covalent/terraform.tfstate)
rm -f covalent_kubernetes_plugin/infra/templates/cluster_autoscaler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 4.23"
version = "5.17.0"
}
}
}
Expand Down Expand Up @@ -83,6 +83,7 @@ resource "aws_ecr_repository" "ecr_repository" {

resource "aws_s3_bucket" "s3_bucket" {
bucket = var.aws_s3_bucket
force_destroy = true
}

data "aws_iam_policy_document" "s3_access_document" {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ metadata:
spec:
template:
spec:
restartPolicy: Never
containers:
- name: covalent-k8s-test
image: "hello-world:latest"
restartPolicy: Never
backoffLimit: 4
image: hello-world:latest
backoffLimit: 4
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 6 additions & 4 deletions covalent_kubernetes_plugin/k8s.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,11 +220,12 @@ def _format_exec_script(

# Execution preamble
exec_script = """
import os
import cloudpickle as pickle
local_func_filename = os.path.join("{docker_working_dir}", "{func_filename}")
local_result_filename = os.path.join("{docker_working_dir}", "{result_filename}")
import os
import cloudpickle as pickle
local_func_filename = os.path.join("{docker_working_dir}", "{func_filename}")
local_result_filename = os.path.join("{docker_working_dir}", "{result_filename}")
""".format(
docker_working_dir=docker_working_dir,
Expand Down Expand Up @@ -449,6 +450,7 @@ def _package_and_upload(
raise Exception(proc.stderr.decode("utf-8"))
else:
app_log.debug("Uploading image to ECR.")
app_log.debug(f"the image URI is {image_uri}")
response = docker_client.images.push(image_uri, tag=image_tag)
app_log.debug(f"Response: {response}")

Expand Down
26 changes: 0 additions & 26 deletions infra/defaults.tfvars

This file was deleted.

2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
covalent==0.177.0.post1.dev1
covalent==0.220.0.post2
docker==6.0.0
kubernetes==24.2.0

0 comments on commit 8330a1e

Please sign in to comment.