From dd05729a479614b95f4d3efd49008c97a961883e Mon Sep 17 00:00:00 2001 From: Imran Qureshi Date: Tue, 20 Aug 2024 20:14:38 -0700 Subject: [PATCH 1/3] update github runners --- .github/workflows/build_and_test.yml | 4 ++-- .github/workflows/python-publish.yml | 4 ++-- .pre-commit-config.yaml | 2 +- docker-compose.yml | 1 - pre-commit.Dockerfile | 7 +++---- 5 files changed, 8 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 55f74fc2..d8358318 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -14,8 +14,8 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 with: python-version: '3.12' diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 1fc024ff..18595356 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -13,9 +13,9 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: '3.12' - name: Install dependencies diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 59d21055..ecc38eb9 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,7 @@ exclude: (^.idea/) repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v3.2.0 + rev: v4.6.0 hooks: - id: end-of-file-fixer types: [ python ] diff --git a/docker-compose.yml b/docker-compose.yml index 77210899..f4db3155 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,6 @@ version: '3.5' services: dev: - user: root build: dockerfile: spark.Dockerfile context: . diff --git a/pre-commit.Dockerfile b/pre-commit.Dockerfile index c22dc220..4467323d 100644 --- a/pre-commit.Dockerfile +++ b/pre-commit.Dockerfile @@ -4,11 +4,10 @@ RUN apt-get update && \ apt-get install -y git && \ pip install pipenv -COPY ${project_root}/Pipfile* ./ +COPY Pipfile* ./ -RUN pipenv lock --dev && \ - pipenv sync --dev --system --verbose +RUN pipenv sync --dev --system --extra-pip-args="--prefer-binary" WORKDIR /sourcecode RUN git config --global --add safe.directory /sourcecode -CMD pre-commit run --all-files +CMD ["pre-commit", "run", "--all-files"] From 3ac7339b38c53f95748f6287225b631edbcdc6f8 Mon Sep 17 00:00:00 2001 From: Imran Qureshi Date: Tue, 20 Aug 2024 20:23:00 -0700 Subject: [PATCH 2/3] set write permission --- spark.Dockerfile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/spark.Dockerfile b/spark.Dockerfile index cfc5a8de..f499b58e 100644 --- a/spark.Dockerfile +++ b/spark.Dockerfile @@ -29,5 +29,10 @@ RUN mkdir -p /.local/share/virtualenvs && chmod 777 /.local/share/virtualenvs # USER 1001 # Run as non-root user +# Change ownership of the directory and its subdirectories +RUN chown -R 185:185 /sam + +# Set permissions to allow writing (read, write, execute for owner) +RUN chmod -R 755 /sam # https://spark.apache.org/docs/latest/running-on-kubernetes.html#user-identity USER 185 From 087686bb595b196a75ccf842d112a83ea355b4f4 Mon Sep 17 00:00:00 2001 From: Imran Qureshi Date: Tue, 20 Aug 2024 20:30:12 -0700 Subject: [PATCH 3/3] add back root user for now. will investigate later. --- docker-compose.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/docker-compose.yml b/docker-compose.yml index f4db3155..77210899 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,6 +1,7 @@ version: '3.5' services: dev: + user: root build: dockerfile: spark.Dockerfile context: .