Skip to content

Commit

Permalink
chore: remove centos7 dockerfile for image living in cypress dockerhu…
Browse files Browse the repository at this point in the history
…b (cypress/centos7-builder) [run ci] (#29918)
  • Loading branch information
AtofStryker committed Jul 26, 2024
1 parent 3df6bdb commit 6b761d5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 61 deletions.
43 changes: 10 additions & 33 deletions .circleci/workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ mainBuildFilters: &mainBuildFilters
- 'update-v8-snapshot-cache-on-develop'
- 'remove-json-lint'
- 'publish-binary'
- 'fix/webpack-batteries-included-for-yarn-pnp'
- 'chore/use_build_docker_file_for_centos7'

# usually we don't build Mac app - it takes a long time
# but sometimes we want to really confirm we are doing the right thing
Expand All @@ -54,7 +54,7 @@ linuxArm64WorkflowFilters: &linux-arm64-workflow-filters
- equal: [ develop, << pipeline.git.branch >> ]
# use the following branch as well to ensure that v8 snapshot cache updates are fully tested
- equal: [ 'update-v8-snapshot-cache-on-develop', << pipeline.git.branch >> ]
- equal: [ 'fix/webpack-batteries-included-for-yarn-pnp', << pipeline.git.branch >> ]
- equal: [ 'chore/use_build_docker_file_for_centos7', << pipeline.git.branch >> ]
- matches:
pattern: /^release\/\d+\.\d+\.\d+$/
value: << pipeline.git.branch >>
Expand Down Expand Up @@ -153,7 +153,7 @@ commands:
name: Set environment variable to determine whether or not to persist artifacts
command: |
echo "Setting SHOULD_PERSIST_ARTIFACTS variable"
echo 'if ! [[ "$CIRCLE_BRANCH" != "develop" && "$CIRCLE_BRANCH" != "release/"* && "$CIRCLE_BRANCH" != "fix/webpack-batteries-included-for-yarn-pnp" ]]; then
echo 'if ! [[ "$CIRCLE_BRANCH" != "develop" && "$CIRCLE_BRANCH" != "release/"* && "$CIRCLE_BRANCH" != "chore/use_build_docker_file_for_centos7" ]]; then
export SHOULD_PERSIST_ARTIFACTS=true
fi' >> "$BASH_ENV"
# You must run `setup_should_persist_artifacts` command and be using bash before running this command
Expand Down Expand Up @@ -362,7 +362,7 @@ commands:
steps:
- restore_cache:
name: Restore cache state, to check for known modules cache existence
key: v{{ checksum ".circleci/cache-version.txt" }}-{{ checksum "platform_key" }}-state-of-node-modules-cache-{{ checksum "circle_cache_key" }}-{{ checksum "centos7-builder.Dockerfile" }}
key: v{{ checksum ".circleci/cache-version.txt" }}-{{ checksum "platform_key" }}-state-of-node-modules-cache-{{ checksum "circle_cache_key" }}-centos7
- unless:
condition: <<parameters.build-better-sqlite3>>
steps:
Expand Down Expand Up @@ -421,7 +421,7 @@ commands:
steps:
- save_cache:
name: Saving node-modules cache state key
key: v{{ checksum ".circleci/cache-version.txt" }}-{{ checksum "platform_key" }}-state-of-node-modules-cache-{{ checksum "circle_cache_key" }}-{{ checksum "centos7-builder.Dockerfile" }}
key: v{{ checksum ".circleci/cache-version.txt" }}-{{ checksum "platform_key" }}-state-of-node-modules-cache-{{ checksum "circle_cache_key" }}-centos7
paths:
- node_modules_installed
- unless:
Expand Down Expand Up @@ -515,45 +515,22 @@ commands:
echo "Google Chrome Version: `google-chrome-<<parameters.channel>> --version`"
# This code builds better-sqlite3 on CentOS 7. This is necessary because CentOS 7 has the oldest glibc version
# that we support. The script checks for the existence of the Centos7-builder image tar file, and skips if it already
# exists. If you want to rebuild the image, set the REBUILD_CENTOS_BUILDER_IMAGE environment variable to any value.
# that we support. This job uses the cypress/centos7-builder https://hub.docker.com/repository/docker/cypress/centos7-builder/general
# image to build better-sqlite3 against an older version of glibc (2.17).
# Since this is running Docker remote, we need to copy the project into the container, and copy the built plugin out
# of the container because the host running docker does not have access to the project directory so volume mounts are
# not possible. The built plugin is copied to the project directory so it can be injected into the final binary.
build-better-sqlite3:
description: Build better-sqlite3 for CentOS 7
steps:
- setup_remote_docker
- restore_cache:
keys:
- cypress-centos7-builder-{{ checksum "centos7-builder.Dockerfile" }}
- restore_cache:
keys:
- better-sqlite3-{{ checksum "node_modules/better-sqlite3/package.json" }}-{{ checksum "node_modules/electron/package.json" }}-{{ checksum "centos7-builder.Dockerfile" }}
- run:
name: Build or load centos7-builder image
name: Build better-sqlite3 for CentOS 7
command: |
if [[ ! -f better_sqlite3.node ]]; then
set -x
apt update && apt install -y docker.io
if [[ ! -f centos7-builder.tar || -n $REBUILD_CENTOS_BUILDER_IMAGE ]]; then
echo "*" > .dockerignore
docker build -t centos7-builder -f centos7-builder.Dockerfile .
docker save centos7-builder > centos7-builder.tar
rm .dockerignore
else
docker load < centos7-builder.tar
fi
fi
- save_cache:
key: cypress-centos7-builder-{{ checksum "centos7-builder.Dockerfile" }}
paths:
- centos7-builder.tar
- run:
name: Build better-sqlite3 for CentOS 7
command: |
if [[ ! -f better_sqlite3.node ]]; then
docker run -d --name centos7-builder centos7-builder /bin/bash -c "sleep 1000000000"
docker run -d --name centos7-builder cypress/centos7-builder:latest /bin/bash -c "sleep 1000000000"
docker cp ~/cypress/node_modules/better-sqlite3 centos7-builder:/better-sqlite3
docker exec -it centos7-builder /bin/bash -c "cd /better-sqlite3 && source /root/.bashrc && chown -R root:root . && npm install --ignore-scripts && npx --no-install prebuild -r electron -t 27.1.3 --include-regex 'better_sqlite3.node$'"
docker cp centos7-builder:/better-sqlite3/build/Release/better_sqlite3.node ~/cypress/node_modules/better-sqlite3/build/Release/better_sqlite3.node
Expand All @@ -563,7 +540,7 @@ commands:
cp ~/cypress/better_sqlite3.node ~/cypress/node_modules/better-sqlite3/build/Release/better_sqlite3.node
fi
- save_cache:
key: better-sqlite3-{{ checksum "node_modules/better-sqlite3/package.json" }}-{{ checksum "node_modules/electron/package.json" }}-{{ checksum "centos7-builder.Dockerfile" }}
key: better-sqlite3-{{ checksum "node_modules/better-sqlite3/package.json" }}-{{ checksum "node_modules/electron/package.json" }}-centos7
paths:
- better_sqlite3.node
- run:
Expand Down
28 changes: 0 additions & 28 deletions centos7-builder.Dockerfile

This file was deleted.

4 comments on commit 6b761d5

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 6b761d5 Jul 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the linux arm64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/13.13.2/linux-arm64/develop-6b761d576ea994541744da3ee068c319aa064e5d/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 6b761d5 Jul 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the win32 x64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/13.13.2/win32-x64/develop-6b761d576ea994541744da3ee068c319aa064e5d/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 6b761d5 Jul 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the darwin arm64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/13.13.2/darwin-arm64/develop-6b761d576ea994541744da3ee068c319aa064e5d/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 6b761d5 Jul 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the darwin x64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/13.13.2/darwin-x64/develop-6b761d576ea994541744da3ee068c319aa064e5d/cypress.tgz

Please sign in to comment.