mirror of
https://github.com/postgres/postgres.git
synced 2026-06-09 00:32:10 -04:00
ci: Remove support for cirrus-ci based CI
As mentioned in the earlier commit, cirrus-ci has shut down. Therefore remove all files related to running CI via cirrus. Also update comments / code that were referencing cirrus-ci. Discussion: https://postgr.es/m/3ydjipcr7kbss57nvi67noplncqhesl5eyb6wgol4ccjxynspv%40yatlykpribmm
This commit is contained in:
parent
9c126063b1
commit
68c8a365d4
7 changed files with 11 additions and 1296 deletions
143
.cirrus.star
143
.cirrus.star
|
|
@ -1,143 +0,0 @@
|
|||
"""Additional CI configuration, using the starlark language. See
|
||||
https://cirrus-ci.org/guide/programming-tasks/#introduction-into-starlark
|
||||
|
||||
See also the starlark specification at
|
||||
https://github.com/bazelbuild/starlark/blob/master/spec.md
|
||||
|
||||
See also .cirrus.yml and src/tools/ci/README
|
||||
"""
|
||||
|
||||
load("cirrus", "env", "fs", "re", "yaml")
|
||||
|
||||
|
||||
def main():
|
||||
"""The main function is executed by cirrus-ci after loading .cirrus.yml and can
|
||||
extend the CI definition further.
|
||||
|
||||
As documented in .cirrus.yml, the final CI configuration is composed of
|
||||
|
||||
1) the contents of .cirrus.yml
|
||||
|
||||
2) computed environment variables
|
||||
|
||||
3) if defined, the contents of the file referenced by the, repository
|
||||
level, REPO_CI_CONFIG_GIT_URL variable (see
|
||||
https://cirrus-ci.org/guide/programming-tasks/#fs for the accepted
|
||||
format)
|
||||
|
||||
4) .cirrus.tasks.yml
|
||||
"""
|
||||
|
||||
output = ""
|
||||
|
||||
# 1) is evaluated implicitly
|
||||
|
||||
|
||||
# Add 2)
|
||||
additional_env = compute_environment_vars()
|
||||
env_fmt = """
|
||||
###
|
||||
# Computed environment variables start here
|
||||
###
|
||||
{0}
|
||||
###
|
||||
# Computed environment variables end here
|
||||
###
|
||||
"""
|
||||
output += env_fmt.format(yaml.dumps({'env': additional_env}))
|
||||
|
||||
|
||||
# Add 3)
|
||||
repo_config_url = env.get("REPO_CI_CONFIG_GIT_URL")
|
||||
if repo_config_url != None:
|
||||
print("loading additional configuration from \"{}\"".format(repo_config_url))
|
||||
output += config_from(repo_config_url)
|
||||
else:
|
||||
output += "\n# REPO_CI_CONFIG_URL was not set\n"
|
||||
|
||||
|
||||
# Add 4)
|
||||
output += config_from(".cirrus.tasks.yml")
|
||||
|
||||
|
||||
return output
|
||||
|
||||
|
||||
def compute_environment_vars():
|
||||
cenv = {}
|
||||
|
||||
###
|
||||
# Some tasks are manually triggered by default because they might use too
|
||||
# many resources for users of free Cirrus credits, but they can be
|
||||
# triggered automatically by naming them in an environment variable e.g.
|
||||
# REPO_CI_AUTOMATIC_TRIGGER_TASKS="task_name other_task" under "Repository
|
||||
# Settings" on Cirrus CI's website.
|
||||
|
||||
default_manual_trigger_tasks = ['mingw', 'netbsd', 'openbsd']
|
||||
|
||||
repo_ci_automatic_trigger_tasks = env.get('REPO_CI_AUTOMATIC_TRIGGER_TASKS', '')
|
||||
for task in default_manual_trigger_tasks:
|
||||
name = 'CI_TRIGGER_TYPE_' + task.upper()
|
||||
if repo_ci_automatic_trigger_tasks.find(task) != -1:
|
||||
value = 'automatic'
|
||||
else:
|
||||
value = 'manual'
|
||||
cenv[name] = value
|
||||
###
|
||||
|
||||
###
|
||||
# Parse "ci-os-only:" tag in commit message and set
|
||||
# CI_{$OS}_ENABLED variable for each OS
|
||||
|
||||
# We want to disable SanityCheck if testing just a specific OS. This
|
||||
# shortens push-wait-for-ci cycle time a bit when debugging operating
|
||||
# system specific failures. Just treating it as an OS in that case
|
||||
# suffices.
|
||||
|
||||
operating_systems = [
|
||||
'compilerwarnings',
|
||||
'freebsd',
|
||||
'linux',
|
||||
'macos',
|
||||
'mingw',
|
||||
'netbsd',
|
||||
'openbsd',
|
||||
'sanitycheck',
|
||||
'windows',
|
||||
]
|
||||
commit_message = env.get('CIRRUS_CHANGE_MESSAGE')
|
||||
match_re = r"(^|.*\n)ci-os-only: ([^\n]+)($|\n.*)"
|
||||
|
||||
# re.match() returns an array with a tuple of (matched-string, match_1, ...)
|
||||
m = re.match(match_re, commit_message)
|
||||
if m and len(m) > 0:
|
||||
os_only = m[0][2]
|
||||
os_only_list = re.split(r'[, ]+', os_only)
|
||||
else:
|
||||
os_only_list = operating_systems
|
||||
|
||||
for os in operating_systems:
|
||||
os_enabled = os in os_only_list
|
||||
cenv['CI_{0}_ENABLED'.format(os.upper())] = os_enabled
|
||||
###
|
||||
|
||||
return cenv
|
||||
|
||||
|
||||
def config_from(config_src):
|
||||
"""return contents of config file `config_src`, surrounded by markers
|
||||
indicating start / end of the included file
|
||||
"""
|
||||
|
||||
config_contents = fs.read(config_src)
|
||||
config_fmt = """
|
||||
|
||||
###
|
||||
# contents of config file `{0}` start here
|
||||
###
|
||||
{1}
|
||||
###
|
||||
# contents of config file `{0}` end here
|
||||
###
|
||||
"""
|
||||
return config_fmt.format(config_src, config_contents)
|
||||
1022
.cirrus.tasks.yml
1022
.cirrus.tasks.yml
File diff suppressed because it is too large
Load diff
91
.cirrus.yml
91
.cirrus.yml
|
|
@ -1,91 +0,0 @@
|
|||
# CI configuration file for CI utilizing cirrus-ci.org
|
||||
#
|
||||
# For instructions on how to enable the CI integration in a repository and
|
||||
# further details, see src/tools/ci/README
|
||||
#
|
||||
#
|
||||
# The actual CI tasks are defined in .cirrus.tasks.yml. To make the compute
|
||||
# resources for CI configurable on a repository level, the "final" CI
|
||||
# configuration is the combination of:
|
||||
#
|
||||
# 1) the contents of this file
|
||||
#
|
||||
# 2) computed environment variables
|
||||
#
|
||||
# Used to enable/disable tasks based on the execution environment. See
|
||||
# .cirrus.star: compute_environment_vars()
|
||||
#
|
||||
# 3) if defined, the contents of the file referenced by the, repository
|
||||
# level, REPO_CI_CONFIG_GIT_URL variable (see
|
||||
# https://cirrus-ci.org/guide/programming-tasks/#fs for the accepted
|
||||
# format)
|
||||
#
|
||||
# This allows running tasks in a different execution environment than the
|
||||
# default, e.g. to have sufficient resources for cfbot.
|
||||
#
|
||||
# 4) .cirrus.tasks.yml
|
||||
#
|
||||
# This composition is done by .cirrus.star
|
||||
|
||||
|
||||
env:
|
||||
# Source of images / containers
|
||||
GCP_PROJECT: pg-ci-images
|
||||
IMAGE_PROJECT: $GCP_PROJECT
|
||||
CONTAINER_REPO: us-docker.pkg.dev/${GCP_PROJECT}/ci
|
||||
DISK_SIZE: 25
|
||||
|
||||
|
||||
# Define how to run various types of tasks.
|
||||
|
||||
# VMs provided by cirrus-ci. Each user has a limited number of "free" credits
|
||||
# for testing.
|
||||
cirrus_community_vm_template: &cirrus_community_vm_template
|
||||
compute_engine_instance:
|
||||
image_project: $IMAGE_PROJECT
|
||||
image: family/$IMAGE_FAMILY
|
||||
platform: $PLATFORM
|
||||
cpu: $CPUS
|
||||
disk: $DISK_SIZE
|
||||
|
||||
|
||||
default_linux_task_template: &linux_task_template
|
||||
env:
|
||||
PLATFORM: linux
|
||||
<<: *cirrus_community_vm_template
|
||||
|
||||
|
||||
default_freebsd_task_template: &freebsd_task_template
|
||||
env:
|
||||
PLATFORM: freebsd
|
||||
<<: *cirrus_community_vm_template
|
||||
|
||||
default_netbsd_task_template: &netbsd_task_template
|
||||
env:
|
||||
PLATFORM: netbsd
|
||||
<<: *cirrus_community_vm_template
|
||||
|
||||
default_openbsd_task_template: &openbsd_task_template
|
||||
env:
|
||||
PLATFORM: openbsd
|
||||
<<: *cirrus_community_vm_template
|
||||
|
||||
|
||||
default_windows_task_template: &windows_task_template
|
||||
env:
|
||||
PLATFORM: windows
|
||||
<<: *cirrus_community_vm_template
|
||||
|
||||
|
||||
# macos workers provided by cirrus-ci
|
||||
default_macos_task_template: &macos_task_template
|
||||
env:
|
||||
PLATFORM: macos
|
||||
macos_instance:
|
||||
image: $IMAGE
|
||||
|
||||
|
||||
# Contents of REPO_CI_CONFIG_GIT_URL, if defined, will be inserted here,
|
||||
# followed by the contents .cirrus.tasks.yml. This allows
|
||||
# REPO_CI_CONFIG_GIT_URL to override how the task types above will be
|
||||
# executed, e.g. using a custom compute account or permanent workers.
|
||||
|
|
@ -18,13 +18,13 @@ $primary->append_conf('postgresql.conf', 'autovacuum = off');
|
|||
$primary->start;
|
||||
|
||||
# Create a couple of tables (~264KB each).
|
||||
# Note: Cirrus CI runs some tests with a very small segment size, so, in that
|
||||
# Note: CI runs some tests with a very small segment size, so, in that
|
||||
# environment, a single table of 264KB would have both a segment with a link
|
||||
# count of 1 and also one with a link count of 2. But in a normal installation,
|
||||
# segment size is 1GB. Therefore, we use 2 different tables here: for test_1,
|
||||
# all segments (or the only one) will have two hard links; for test_2, the
|
||||
# last segment (or the only one) will have 1 hard link, and any others will
|
||||
# have 2.
|
||||
# count of 1 and also one with a link count of 2. But in a normal
|
||||
# installation, segment size is 1GB. Therefore, we use 2 different tables
|
||||
# here: for test_1, all segments (or the only one) will have two hard links;
|
||||
# for test_2, the last segment (or the only one) will have 1 hard link, and
|
||||
# any others will have 2.
|
||||
my $query = <<'EOM';
|
||||
CREATE TABLE test_%s AS
|
||||
SELECT x.id::bigint,
|
||||
|
|
|
|||
|
|
@ -363,9 +363,8 @@ This tries to connect to the server, to test whether it works or not,,
|
|||
so the server is up and running. Otherwise this can return 0 even if
|
||||
there's nothing wrong with raw_connect() itself.
|
||||
|
||||
Notably, raw_connect() does not work on Unix domain sockets on
|
||||
Strawberry perl 5.26.3.1 on Windows, which we use in Cirrus CI images
|
||||
as of this writing. It dies with "not implemented on this
|
||||
Notably, raw_connect() does not work on Unix domain sockets on at least
|
||||
Strawberry perl 5.26.3.1 on Windows. It dies with "not implemented on this
|
||||
architecture".
|
||||
|
||||
=cut
|
||||
|
|
|
|||
|
|
@ -6,8 +6,7 @@
|
|||
# when packages are installed or removed. Any package this script is
|
||||
# not instructed to install, will be removed again.
|
||||
#
|
||||
# This currently expects to be run in a GitHub Actions or cirrus-ci
|
||||
# macOS environment.
|
||||
# This currently expects to be run in a GitHub Actions macOS environment.
|
||||
|
||||
set -e
|
||||
# set -x
|
||||
|
|
@ -39,8 +38,8 @@ fi
|
|||
|
||||
cache_dmg="macports.hfs.dmg"
|
||||
|
||||
if [ "$CIRRUS_CI" != "true" ] && [ "$GITHUB_ACTIONS" != "true" ]; then
|
||||
echo "expect to be called within cirrus-ci or GitHub Actions" 1>&2
|
||||
if [ "$GITHUB_ACTIONS" != "true" ]; then
|
||||
echo "expect to be called within GitHub Actions" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
|
|
|||
|
|
@ -1,27 +0,0 @@
|
|||
#!/bin/sh
|
||||
# Move working directory into a RAM disk for better performance.
|
||||
|
||||
set -e
|
||||
set -x
|
||||
|
||||
mv $CIRRUS_WORKING_DIR $CIRRUS_WORKING_DIR.orig
|
||||
mkdir $CIRRUS_WORKING_DIR
|
||||
|
||||
case "`uname`" in
|
||||
FreeBSD|NetBSD)
|
||||
mount -t tmpfs tmpfs $CIRRUS_WORKING_DIR
|
||||
;;
|
||||
OpenBSD)
|
||||
umount /dev/sd0j # unused /usr/obj partition
|
||||
printf "m j\n\n\nswap\nw\nq\n" | disklabel -E sd0
|
||||
swapon /dev/sd0j
|
||||
# Remove the per-process data segment limit so that mount_mfs can allocate
|
||||
# large memory filesystems. Without this, mount_mfs mmap() may fail with
|
||||
# "Cannot allocate memory" if the requested size exceeds the current
|
||||
# datasize limit.
|
||||
ulimit -d unlimited
|
||||
mount -t mfs -o rw,noatime,nodev,-s=10000000 swap $CIRRUS_WORKING_DIR
|
||||
;;
|
||||
esac
|
||||
|
||||
cp -a $CIRRUS_WORKING_DIR.orig/. $CIRRUS_WORKING_DIR/
|
||||
Loading…
Reference in a new issue