Skip to content

Commit

Permalink
Update Python to 3.9 (default in Linux2023)
Browse files Browse the repository at this point in the history
  • Loading branch information
dlpzx committed Dec 1, 2023
1 parent 7d25ff6 commit 479b0c0
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 17 deletions.
4 changes: 2 additions & 2 deletions backend/docker/dev/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ FROM public.ecr.aws/amazonlinux/amazonlinux:2023

ARG NODE_VERSION=18
ARG NVM_VERSION=v0.37.2
ARG PYTHON_VERSION=python3.8
ARG PYTHON_VERSION=python3.9

RUN dnf clean all
RUN dnf -y install shadow-utils wget
RUN dnf -y install openssl-devel bzip2-devel libffi-devel postgresql-devel gcc unzip tar gzip
RUN dnf install $PYTHON_VERSION
RUN dnf -y install python38-devel
RUN dnf -y install python39-devel
RUN dnf -y install git

RUN /bin/bash -c "ln -s /usr/bin/${PYTHON_VERSION} /usr/bin/python3"
Expand Down
4 changes: 2 additions & 2 deletions backend/docker/prod/ecs/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM public.ecr.aws/amazonlinux/amazonlinux:2023
ARG NODE_VERSION=18
ARG NVM_VERSION=v0.37.2
ARG DEEQU_VERSION=2.0.0-spark-3.1
ARG PYTHON_VERSION=python3.8
ARG PYTHON_VERSION=python3.9

# Installing libraries
RUN dnf upgrade -y \
Expand All @@ -17,7 +17,7 @@ RUN dnf upgrade -y \
shadow-utils wget openssl-devel bzip2-devel libffi-devel \
postgresql-devel gcc unzip tar gzip \
&& dnf install $PYTHON_VERSION \
&& dnf install -y python38-devel git \
&& dnf install -y python39-devel git \
&& /bin/bash -c "ln -s /usr/bin/${PYTHON_VERSION} /usr/bin/python3" \
&& curl https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip -o /tmp/awscliv2.zip \
&& unzip -q /tmp/awscliv2.zip -d /opt \
Expand Down
8 changes: 4 additions & 4 deletions backend/docker/prod/lambda/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
FROM public.ecr.aws/amazonlinux/amazonlinux:2023

ARG FUNCTION_DIR="/home/app/"
ARG PYTHON_VERSION=python3.8
ARG PYTHON_VERSION=python3.9

RUN dnf upgrade -y;\
find /var/tmp -name "*.rpm" -print -delete ;\
find /tmp -name "*.rpm" -print -delete ;\
dnf autoremove -y; \
dnf clean packages; dnf clean headers; dnf clean metadata; dnf clean all; rm -rfv /var/cache/dnf
dnf clean all; rm -rfv /var/cache/dnf

RUN dnf -y install shadow-utils wget
RUN dnf -y install openssl-devel bzip2-devel libffi-devel postgresql-devel gcc unzip tar gzip
RUN dnf install $PYTHON_VERSION
RUN dnf -y install python38-devel
RUN dnf -y install python39-devel

## Add your source
WORKDIR ${FUNCTION_DIR}
Expand All @@ -30,5 +30,5 @@ COPY config.json ./config.json
RUN $PYTHON_VERSION -m pip install awslambdaric --target ${FUNCTION_DIR}

# Command can be overwritten by providing a different command in the template directly.
ENTRYPOINT [ "python3.8", "-m", "awslambdaric" ]
ENTRYPOINT [ "python3.9", "-m", "awslambdaric" ]
CMD ["auth_handler.handler"]
14 changes: 7 additions & 7 deletions deploy/stacks/container.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def __init__(
container_definitions=[ecs.CfnTaskDefinition.ContainerDefinitionProperty(
image=cdkproxy_image.image_name,
name=cdkproxy_container_name,
command=['python3.8', '-m', 'dataall.core.stacks.tasks.cdkproxy'],
command=['python3.9', '-m', 'dataall.core.stacks.tasks.cdkproxy'],
environment=[
ecs.CfnTaskDefinition.KeyValuePairProperty(
name="AWS_REGION",
Expand Down Expand Up @@ -156,7 +156,7 @@ def __init__(

stacks_updater, stacks_updater_task_def = self.set_scheduled_task(
cluster=cluster,
command=['python3.8', '-m', 'dataall.core.environment.tasks.env_stacks_updater'],
command=['python3.9', '-m', 'dataall.core.environment.tasks.env_stacks_updater'],
container_id=f'container',
ecr_repository=ecr_repository,
environment=self._create_env('INFO'),
Expand Down Expand Up @@ -213,7 +213,7 @@ def __init__(
def add_catalog_indexer_task(self):
catalog_indexer_task, catalog_indexer_task_def = self.set_scheduled_task(
cluster=self.ecs_cluster,
command=['python3.8', '-m', 'dataall.modules.catalog.tasks.catalog_indexer_task'],
command=['python3.9', '-m', 'dataall.modules.catalog.tasks.catalog_indexer_task'],
container_id=f'container',
ecr_repository=self._ecr_repository,
environment=self._create_env('INFO'),
Expand Down Expand Up @@ -251,7 +251,7 @@ def add_share_management_task(self):
repository=self._ecr_repository, tag=self._cdkproxy_image_tag
),
environment=self._create_env('DEBUG'),
command=['python3.8', '-m', 'dataall.modules.dataset_sharing.tasks.share_manager_task'],
command=['python3.9', '-m', 'dataall.modules.dataset_sharing.tasks.share_manager_task'],
logging=ecs.LogDriver.aws_logs(
stream_prefix='task',
log_group=self.create_log_group(
Expand Down Expand Up @@ -281,7 +281,7 @@ def add_subscription_task(self):
subscriptions_task, subscription_task_def = self.set_scheduled_task(
cluster=self.ecs_cluster,
command=[
'python3.8',
'python3.9',
'-m',
'dataall.modules.datasets.tasks.dataset_subscription_task',
],
Expand All @@ -306,7 +306,7 @@ def add_subscription_task(self):
def add_bucket_policy_updater_task(self):
update_bucket_policies_task, update_bucket_task_def = self.set_scheduled_task(
cluster=self.ecs_cluster,
command=['python3.8', '-m', 'dataall.modules.datasets.tasks.bucket_policy_updater'],
command=['python3.9', '-m', 'dataall.modules.datasets.tasks.bucket_policy_updater'],
container_id=f'container',
ecr_repository=self._ecr_repository,
environment=self._create_env('DEBUG'),
Expand All @@ -328,7 +328,7 @@ def add_bucket_policy_updater_task(self):
def add_sync_dataset_table_task(self):
sync_tables_task, sync_tables_task_def = self.set_scheduled_task(
cluster=self.ecs_cluster,
command=['python3.8', '-m', 'dataall.modules.datasets.tasks.tables_syncer'],
command=['python3.9', '-m', 'dataall.modules.datasets.tasks.tables_syncer'],
container_id=f'container',
ecr_repository=self._ecr_repository,
environment=self._create_env('INFO'),
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ services:
build:
context: ./backend
dockerfile: docker/dev/Dockerfile
entrypoint: /bin/bash -c "../build/wait-for-it.sh elasticsearch:9200 -t 30 && python3.8 local_graphql_server.py"
entrypoint: /bin/bash -c "../build/wait-for-it.sh elasticsearch:9200 -t 30 && python3.9 local_graphql_server.py"
expose:
- 5000
ports:
Expand Down
2 changes: 1 addition & 1 deletion documentation/userguide/docker/prod/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM public.ecr.aws/amazonlinux/amazonlinux:2023

ARG NODE_VERSION=18
ARG PYTHON_VERSION=3.8
ARG PYTHON_VERSION=3.9
ARG NGINX_VERSION=1.12
ARG ENVSUBST_VERSION=v1.1.0

Expand Down

0 comments on commit 479b0c0

Please sign in to comment.