diff --git a/.github/workflows/build-base-images.yaml b/.github/workflows/build-base-images.yaml index b18ec65526..f6a50ae1c9 100644 --- a/.github/workflows/build-base-images.yaml +++ b/.github/workflows/build-base-images.yaml @@ -64,8 +64,8 @@ jobs: # https://github.com/marketplace/actions/build-and-push-docker-images#inputs # '`List` type is a newline-delimited string' build-args: | + BASE_IMAGE=${{ matrix.base_image_name }}:${{ matrix.base_image_tag }} BASE_IMAGE_NAME=${{ matrix.base_image_name }} - BASE_IMAGE_TAG=${{ matrix.base_image_tag }} tags: ghcr.io/saveourtool/save-base:${{ matrix.base_image_name }}-${{ env.FORMATTED_TAG }} build_custom_builder_image: diff --git a/save-agent/src/commonMain/kotlin/com/saveourtool/save/agent/SaveAgent.kt b/save-agent/src/commonMain/kotlin/com/saveourtool/save/agent/SaveAgent.kt index 63dad74c2c..9aadaf0601 100644 --- a/save-agent/src/commonMain/kotlin/com/saveourtool/save/agent/SaveAgent.kt +++ b/save-agent/src/commonMain/kotlin/com/saveourtool/save/agent/SaveAgent.kt @@ -30,7 +30,6 @@ import okio.use import kotlinx.coroutines.* import kotlinx.datetime.Clock -import kotlinx.serialization.decodeFromString import kotlinx.serialization.json.Json import kotlinx.serialization.modules.SerializersModule import kotlinx.serialization.modules.polymorphic @@ -90,7 +89,6 @@ class SaveAgent( // a temporary workaround for python integration private fun executeAdditionallySetup( - targetDirectory: Path, additionalFileNames: Collection, setupShTimeoutMillis: Long, ) = runCatching { @@ -210,7 +208,7 @@ class SaveAgent( } // a temporary workaround for python integration - executeAdditionallySetup(targetDirectory, agentInitConfig.additionalFileNameToUrl.keys, agentInitConfig.setupShTimeoutMillis) + executeAdditionallySetup(agentInitConfig.additionalFileNameToUrl.keys, agentInitConfig.setupShTimeoutMillis) .runIf( failureResultPredicate ) { diff --git a/save-deploy/base-images/Dockerfile b/save-deploy/base-images/Dockerfile index 66e2f05d39..1c8a503238 100644 --- a/save-deploy/base-images/Dockerfile +++ b/save-deploy/base-images/Dockerfile @@ -1,14 +1,17 @@ +ARG BASE_IMAGE + +FROM $BASE_IMAGE + ARG BASE_IMAGE_NAME -ARG BASE_IMAGE_TAG -FROM $BASE_IMAGE_NAME:$BASE_IMAGE_TAG -RUN apt-get update && env DEBIAN_FRONTEND="noninteractive" apt-get install -y curl libcurl4-openssl-dev tzdata unzip +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt-get update && apt-get install -y curl libcurl4-openssl-dev tzdata unzip RUN ln -fs /usr/share/zoneinfo/UTC /etc/localtime -RUN rm -rf /var/lib/apt/lists/* # clang-12 can only be installed to ubuntu and is only needed for GSAC contest -RUN if [[ "$BASE_IMAGE_NAME" == "ubuntu" ]]; then \ - apt-get update && env DEBIAN_FRONTEND="noninteractive" apt-get install -y clang-12 clang-format libclang-12-dev; \ +RUN if [ "$BASE_IMAGE_NAME" = "ubuntu" ]; then \ + apt-get install -y clang-12 clang-format libclang-12-dev; \ fi # Fixme: https://github.com/saveourtool/save-cloud/issues/352 @@ -18,6 +21,8 @@ RUN if [[ "$BASE_IMAGE_NAME" == "python" ]]; then \ ln -s $(which java) /usr/bin/java; \ fi +RUN rm -rf /var/lib/apt/lists/* + RUN groupadd --gid 1100 save-agent && \ useradd --uid 1100 --gid 1100 --create-home --shell /bin/sh save-agent && \ # `WORKDIR` directive creates the directory as `root` user unless the directory already exists