Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
4141done committed Nov 15, 2023
1 parent 6f1ec35 commit fad88de
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 34 deletions.
7 changes: 0 additions & 7 deletions bin/setup_venv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -206,9 +206,6 @@ pip3 install pipenv
pip3 install wheel
pip3 install nodeenv

# `pipenv sync` uses only the information in the `Pipfile.lock` ensuring repeatable builds
# PIPENV_VERBOSITY=-1 PIPENV_PIPFILE="${script_dir}/../pulumi/python/Pipfile" pipenv sync --dev

# Install node.js into virtual environment so that it can be used by Python
# modules that make call outs to it.
if [ ! -x "${VIRTUAL_ENV}/bin/node" ]; then
Expand All @@ -217,14 +214,10 @@ else
echo "Node.js version $("${VIRTUAL_ENV}/bin/node" --version) is already installed"
fi

echo "About to install deps"
# Install general package requirements
# `pipenv sync` uses only the information in the `Pipfile.lock` ensuring repeatable builds
PIPENV_VERBOSITY=-1 PIPENV_PIPFILE="${script_dir}/../pulumi/python/Pipfile" pipenv sync


echo "about to install local pulumi utils"
pip3 install setuptools
# Install local common utilities module
pip3 install "${script_dir}/../pulumi/python/utility/kic-pulumi-utils"

Expand Down
8 changes: 3 additions & 5 deletions docker/Dockerfile.debian
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,9 @@ RUN set -eux; \
nano \
vim \
wget \
zlib1g-dev;

RUN su --group runner runner --login --command '/pulumi/projects/kic-reference-architectures/bin/setup_venv.sh';

RUN echo 'source /pulumi/projects/kic-reference-architectures/pulumi/python/venv/bin/activate' >> /pulumi/projects/kic-reference-architectures/.bashrc; \
zlib1g-dev \
su --group runner runner --login --command '/pulumi/projects/kic-reference-architectures/bin/setup_venv.sh' \
echo 'source /pulumi/projects/kic-reference-architectures/pulumi/python/venv/bin/activate' >> /pulumi/projects/kic-reference-architectures/.bashrc; \
apt-get purge --yes \
gcc \
libbz2-dev \
Expand Down
6 changes: 3 additions & 3 deletions pulumi/python/Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ pycryptodome = "~=3.14.0"
requests = "~=2.27.1"
setuptools = "==49.6.0"
setuptools-git-versioning = "==1.9.2"
yamlreader = "*"
yamlreader = "==3.0.4"
pulumi-digitalocean = "==4.12.0"
pulumi = "~=3.93"
grpcio = "*"
grpcio = "==1.56.2"
PyYAML = "==6.0.1"
wheel = "0.41.3"
nodeenv = "~=1.6.0"

[requires]
python_version = "3.11"
python_version = "3.11"
2 changes: 1 addition & 1 deletion pulumi/python/automation/providers/aws.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def validate_selected_azs(selected: List[str]) -> bool:
print(f"AWS availability zones: {', '.join(config['vpc:azs'])}")

# EKS version
default_version = defaults['eks:k8s_version']
default_version = defaults['eks:k8s_version'] or '1.28'
config['eks:k8s_version'] = input(f'EKS Kubernetes version [{default_version}]: ').strip() or default_version
print(f"EKS Kubernetes version: {config['eks:k8s_version']}")

Expand Down
6 changes: 2 additions & 4 deletions pulumi/python/infrastructure/aws/eks/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,13 @@ def retrieve_vpc_and_subnets(vpc) -> VPCDefinition:
)
)

# This gives the EBS CSI Driver role permissions to manage volumes on the ec2 instance
aws.iam.RolePolicyAttachment(
'eks-ebs-csi-driver-policy-attachment',
role=csi_role.id,
policy_arn='arn:aws:iam::aws:policy/service-role/AmazonEBSCSIDriverPolicy'
)

# TODO: Do I need to assign the role to the CSI Driver? Most likely?

# Creating an EKS Addon for the CSI Driver
csi_addon = aws.eks.Addon("aws-ebs-csi-driver",
cluster_name=cluster.eks_cluster.name,
Expand All @@ -139,5 +138,4 @@ def retrieve_vpc_and_subnets(vpc) -> VPCDefinition:
# Export the clusters' kubeconfig
pulumi.export("cluster_name", cluster.eks_cluster.name)
pulumi.export("kubeconfig", cluster.kubeconfig)
pulumi.export("csi_iam_role", csi_role)
pulumi.export("csi_addon", csi_addon)

1 change: 0 additions & 1 deletion pulumi/python/infrastructure/aws/eks/iam.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,3 @@
role=ec2_role.id,
policy_arn='arn:aws:iam::aws:policy/AmazonEC2ContainerRegistryReadOnly',
)

12 changes: 0 additions & 12 deletions pulumi/python/kubernetes/logstore/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,16 +83,8 @@ def project_name_from_project_dir(dirname: str):

# Values from Chart's parameters specified hierarchically,
values={
# "image": {
# "debug": True
# },
# "diagnosticMode": {
# "enabled": True
# },
"master": {
"replicas": master_replicas,
# "livenessProbe": 300,
# "readinessProbe": 180,
"resources": {
"requests": {},
"limits": {}
Expand All @@ -103,8 +95,6 @@ def project_name_from_project_dir(dirname: str):
},
"data": {
"replicas": data_replicas,
# "livenessProbe": 300,
# "readinessProbe": 180,
"resources": {
"requests": {},
"limits": {}
Expand All @@ -116,8 +106,6 @@ def project_name_from_project_dir(dirname: str):
"ingest": {
"enabled": True,
"replicas": ingest_replicas,
# "livenessProbe": 300,
# "readinessProbe": 180,
"resources": {
"requests": {},
"limits": {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,6 @@ def namespace_by_name(name):
provider=k8s_provider))

pstatus = kic_chart.status
pstatus.apply(lambda status: pulumi.log.info(f"[DEBUG]: Helm chart status: {status}"))
srv = Service.get(resource_name="nginx-ingress",
id=Output.concat("nginx-ingress", "/", pstatus.name, "-nginx-ingress-controller"),
opts=pulumi.ResourceOptions(provider=k8s_provider))
Expand Down

0 comments on commit fad88de

Please sign in to comment.