Skip to content

Commit 417be0b

Browse files
committed
Merge branch '3.0-dev' into 3.0
2 parents 2a17e48 + 6e62dc3 commit 417be0b

File tree

189 files changed

+11271
-1230
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

189 files changed

+11271
-1230
lines changed

.CodeQL.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
path_classifiers:
2+
library:
3+
# Treat source files for all compiled languages in the specs directories
4+
# as 3rd party library sources because they are not owned by us.
5+
#
6+
# Extensions from https://codeql.github.com/docs/codeql-overview/supported-languages-and-frameworks/.
7+
- "SPECS*/**/*.c"
8+
- "SPECS*/**/*.c++"
9+
- "SPECS*/**/*.cc"
10+
- "SPECS*/**/*.cpp"
11+
- "SPECS*/**/*.cs"
12+
- "SPECS*/**/*.cshtml"
13+
- "SPECS*/**/*.csproj"
14+
- "SPECS*/**/*.cts"
15+
- "SPECS*/**/*.cxx"
16+
- "SPECS*/**/*.go"
17+
- "SPECS*/**/*.h"
18+
- "SPECS*/**/*.h++"
19+
- "SPECS*/**/*.hh"
20+
- "SPECS*/**/*.hpp"
21+
- "SPECS*/**/*.hxx"
22+
- "SPECS*/**/*.java"
23+
- "SPECS*/**/*.kt"
24+
- "SPECS*/**/*.mts"
25+
- "SPECS*/**/*.sln"
26+
- "SPECS*/**/*.swift"
27+
- "SPECS*/**/*.ts"
28+
- "SPECS*/**/*.tsx"
29+
- "SPECS*/**/*.xaml"

.github/workflows/check-manifests.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ jobs:
2121
# This PR runner uses an older Ubuntu with rpm version 4.17, which doesn't understand some newer macros like %bcond
2222
- name: Define missing rpm macros
2323
run: |
24-
[[ -n $(rpm --eval '%bcond test 1') ]] && echo '%bcond() %[ (%{2}) ? "%{expand:%%bcond_without %{1}}" : "%{expand:%%bcond_with %{1}}" ]' > ~/.rpmmacros
24+
if [[ -n $(rpm --eval '%bcond test 1') ]]; then
25+
echo '%bcond() %[ (%{2}) ? "%{expand:%%bcond_without %{1}}" : "%{expand:%%bcond_with %{1}}" ]' > ~/.rpmmacros
26+
fi
2527
2628
- name: Check x86_64 manifests
2729
run: |

.github/workflows/check-package-cgmanifest.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ jobs:
2222
# This PR runner uses an older Ubuntu with rpm version 4.17, which doesn't understand some newer macros like %bcond
2323
- name: Define missing rpm macros
2424
run: |
25-
[[ -n $(rpm --eval '%bcond test 1') ]] && echo '%bcond() %[ (%{2}) ? "%{expand:%%bcond_without %{1}}" : "%{expand:%%bcond_with %{1}}" ]' > ~/.rpmmacros
25+
if [[ -n $(rpm --eval '%bcond test 1') ]]; then
26+
echo '%bcond() %[ (%{2}) ? "%{expand:%%bcond_without %{1}}" : "%{expand:%%bcond_with %{1}}" ]' > ~/.rpmmacros
27+
fi
2628
2729
- name: Get base commit for PRs
2830
if: ${{ github.event_name == 'pull_request' }}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Copyright (c) Microsoft Corporation.
2+
# Licensed under the MIT License.
3+
4+
ARG BASE_IMAGE
5+
6+
FROM $BASE_IMAGE
7+
8+
@INCLUDE_MAIN_RUN_INSTRUCTION@
9+
10+
RUN set -eux && \
11+
valkey-cli --version && \
12+
valkey-server --version && \
13+
mkdir /data && \
14+
chown valkey:valkey /data
15+
16+
VOLUME /data
17+
WORKDIR /data
18+
19+
COPY valkey-docker-entrypoint.sh /usr/local/bin/
20+
21+
RUN chmod +x /usr/local/bin/valkey-docker-entrypoint.sh
22+
23+
ENTRYPOINT ["/usr/local/bin/valkey-docker-entrypoint.sh"]
24+
25+
EXPOSE 6379
26+
CMD ["valkey-server"]
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/bash
2+
# Copyright (c) Microsoft Corporation.
3+
# Licensed under the MIT License.
4+
set -e
5+
6+
# first arg is `-f` or `--some-option`
7+
# or first arg is `something.conf`
8+
if [ "${1#-}" != "$1" ] || [ "${1%.conf}" != "$1" ]; then
9+
set -- valkey-server "$@"
10+
fi
11+
12+
# allow the container to be started with `--user`
13+
if [ "$1" = 'valkey-server' -a "$(id -u)" = '0' ]; then
14+
find . \! -user valkey -exec chown valkey '{}' +
15+
exec setpriv --reuid=valkey --regid=valkey --init-groups --inh-caps=-all "$BASH_SOURCE" "$@"
16+
fi
17+
18+
# set an appropriate umask (if one isn't set already)
19+
# - https://github.com/docker-library/redis/issues/305
20+
# - https://github.com/redis/redis/blob/bb875603fb7ff3f9d19aad906bd45d7db98d9a39/utils/systemd-redis_server.service#L37
21+
um="$(umask)"
22+
if [ "$um" = '0022' ]; then
23+
umask 0077
24+
fi
25+
26+
exec "$@" $VALKEY_EXTRA_FLAGS
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
valkey
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
valkey
2+
cronie
3+
util-linux

.pipelines/prchecks/PackageBuildPRCheck.yml

Lines changed: 42 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,11 @@ extends:
8080
# GCC fails to build as a regular package.
8181
ignoredSpecs: ["gcc"]
8282

83-
- script: echo "##vso[task.setvariable variable=toolchainArtifactName;isOutput=true]$(ob_artifactBaseName)"
83+
- script: |
84+
echo "##vso[task.setvariable variable=toolchainArtifactName;isOutput=true]$(ob_artifactBaseName)"
85+
echo "##vso[task.setvariable variable=toolchainTarballName;isOutput=true]toolchain_built_rpms_all.tar.gz"
8486
name: "ToolchainArtifactName"
85-
displayName: "Set variable for published artifact name"
87+
displayName: "Set variables for published toolchain tarball"
8688
8789
# 1. Automatic publishing won't work if 'isCustom: true' is set on the pool. We cannot do 'isCustom: false' because
8890
# then OneBranch attempts to perform additional actions (adding build tags for instance), which require additional permissions
@@ -104,24 +106,38 @@ extends:
104106
isCustom: true
105107
name: ${{ configuration.agentPool }}
106108
variables:
109+
inputArtifactsLocation: $(Agent.TempDirectory)
107110
ob_artifactBaseName: $(rpmsArtifactNameBase)_${{ configuration.name }}_$(System.JobAttempt)
108111
ob_outputDirectory: $(Build.ArtifactStagingDirectory)
112+
outputRPMsTarballName: "rpms.tar.gz"
109113
toolchainArtifactName: $[ stageDependencies.Toolchain_${{ configuration.name }}.Build.outputs['ToolchainArtifactName.toolchainArtifactName'] ]
114+
toolchainTarballName: $[ stageDependencies.Toolchain_${{ configuration.name }}.Build.outputs['ToolchainArtifactName.toolchainTarballName'] ]
110115
steps:
116+
- task: DownloadPipelineArtifact@2
117+
displayName: "Download toolchain"
118+
inputs:
119+
artifact: $(toolchainArtifactName)
120+
patterns: "**/$(toolchainTarballName)"
121+
targetPath: $(inputArtifactsLocation)
122+
111123
- template: .pipelines/templates/PackageBuild.yml@self
112124
parameters:
113125
checkBuildRetries: "1"
114-
customToolchainArtifactName: $(toolchainArtifactName)
126+
customToolchainTarballName: $(toolchainTarballName)
127+
inputArtifactsFolder: $(inputArtifactsLocation)
115128
isCheckBuild: true
116129
isQuickRebuildPackages: true
117130
isUseCCache: true
118131
maxCPU: "${{ configuration.maxCPUs }}"
119132
outputArtifactsFolder: $(ob_outputDirectory)
133+
outputRPMsTarballName: $(outputRPMsTarballName)
120134
pipArtifactFeeds: "mariner/Mariner-Pypi-Feed"
121135
selfRepoName: self
122136
testSuiteName: "[${{ configuration.name }}] Package test"
123137

124-
- script: echo "##vso[task.setvariable variable=rpmsArtifactName;isOutput=true]$(ob_artifactBaseName)"
138+
- script: |
139+
echo "##vso[task.setvariable variable=rpmsArtifactName;isOutput=true]$(ob_artifactBaseName)"
140+
echo "##vso[task.setvariable variable=rpmsTarballName;isOutput=true]$(outputRPMsTarballName)"
125141
name: "RPMsArtifactName"
126142
displayName: "Set variable for published artifact name"
127143
@@ -142,15 +158,25 @@ extends:
142158
isCustom: true
143159
name: ${{ configuration.agentPool }}
144160
variables:
161+
inputArtifactsLocation: $(Agent.TempDirectory)
145162
ob_artifactBaseName: $(toolchainTestsArtifactNameBase)_${{ configuration.name }}_$(System.JobAttempt)
146163
ob_outputDirectory: $(Build.ArtifactStagingDirectory)
147164
testListFromToolchain: $[ stageDependencies.Toolchain_${{ configuration.name }}.Build.outputs['CalculateToolchainPackageRetestList.toolchainPackageRetestList'] ]
148165
toolchainArtifactName: $[ stageDependencies.Toolchain_${{ configuration.name }}.Build.outputs['ToolchainArtifactName.toolchainArtifactName'] ]
166+
toolchainTarballName: $[ stageDependencies.Toolchain_${{ configuration.name }}.Build.outputs['ToolchainArtifactName.toolchainTarballName'] ]
149167
steps:
168+
- task: DownloadPipelineArtifact@2
169+
displayName: "Download toolchain"
170+
inputs:
171+
artifact: $(toolchainArtifactName)
172+
patterns: "**/$(toolchainTarballName)"
173+
targetPath: $(inputArtifactsLocation)
174+
150175
- template: .pipelines/templates/PackageBuild.yml@self
151176
parameters:
152177
checkBuildRetries: "1"
153-
customToolchainArtifactName: $(toolchainArtifactName)
178+
customToolchainTarballName: $(toolchainTarballName)
179+
inputArtifactsFolder: $(inputArtifactsLocation)
154180
isAllowToolchainRebuilds: true
155181
isCheckBuild: true
156182
isQuickRebuildPackages: true
@@ -179,8 +205,18 @@ extends:
179205
isCustom: true
180206
name: ${{ configuration.agentPool }}
181207
variables:
208+
inputArtifactsLocation: $(Agent.TempDirectory)
182209
rpmsArtifactName: $[ stageDependencies.RPMs_${{ configuration.name }}.BuildAndTest.outputs['RPMsArtifactName.rpmsArtifactName'] ]
210+
rpmsTarballName: $[ stageDependencies.RPMs_${{ configuration.name }}.BuildAndTest.outputs['RPMsArtifactName.rpmsTarballName'] ]
183211
steps:
212+
- task: DownloadPipelineArtifact@2
213+
displayName: "Download RPMs tarball"
214+
inputs:
215+
artifact: $(rpmsArtifactName)
216+
patterns: "**/$(rpmsTarballName)"
217+
targetPath: $(inputArtifactsLocation)
218+
184219
- template: .pipelines/templatesWithCheckout/SodiffCheck.yml@self
185220
parameters:
186-
inputArtifactName: $(rpmsArtifactName)
221+
inputArtifactsFolder: $(inputArtifactsLocation)
222+
inputRPMsTarballName: $(rpmsTarballName)

.pipelines/templates/PackageBuild.yml

Lines changed: 14 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,9 @@ parameters:
1414
type: number
1515
default: 12
1616

17-
- name: customToolchainArtifactName
18-
type: string
19-
default: ""
20-
2117
- name: customToolchainTarballName
2218
type: string
23-
default: "toolchain_built_rpms_all.tar.gz"
19+
default: ""
2420

2521
- name: extraPackageRepos
2622
type: string
@@ -30,12 +26,16 @@ parameters:
3026
type: boolean
3127
default: true
3228

33-
- name: inputCacheArtifacts
29+
- name: inputArtifactsFolder
30+
type: string
31+
default: "$(Agent.TempDirectory)"
32+
33+
- name: inputCacheRPMsTarballs
3434
type: object
3535
default: []
3636
# Sample:
37-
# - name: build-artifacts
38-
# rpmsTarball: cache.tar.gz
37+
# - cache.tar.gz
38+
# - cache2.tar.gz
3939

4040
- name: isAllowToolchainRebuilds
4141
type: string
@@ -160,15 +160,9 @@ steps:
160160
artifactFeeds: "${{ parameters.pipArtifactFeeds }}"
161161
displayName: "Authenticate to custom pip artifact feeds"
162162

163-
- ${{ if parameters.customToolchainArtifactName }}:
164-
- task: DownloadPipelineArtifact@2
165-
displayName: "Download toolchain"
166-
inputs:
167-
artifact: "${{ parameters.customToolchainArtifactName }}"
168-
patterns: "**/${{ parameters.customToolchainTarballName }}"
169-
163+
- ${{ if parameters.customToolchainTarballName }}:
170164
- script: |
171-
toolchain_archive="$(find "$(Pipeline.Workspace)" -name "${{ parameters.customToolchainTarballName }}" -print -quit)"
165+
toolchain_archive="$(find "${{ parameters.inputArtifactsFolder }}" -name "${{ parameters.customToolchainTarballName }}" -print -quit)"
172166
if [[ ! -f "$toolchain_archive" ]]; then
173167
echo "ERROR: toolchain archive not found!" >&2
174168
exit 1
@@ -178,17 +172,11 @@ steps:
178172
sudo make -C "${{ parameters.buildRepoRoot }}/toolkit" toolchain TOOLCHAIN_ARCHIVE="$toolchain_archive"
179173
displayName: "Populate toolchain"
180174
181-
- ${{ each inputCacheArtifact in parameters.inputCacheArtifacts }}:
182-
- task: DownloadPipelineArtifact@2
183-
displayName: "Download input cache RPM from ${{ inputCacheArtifact.name }}"
184-
inputs:
185-
artifact: "${{ inputCacheArtifact.name }}"
186-
patterns: "**/${{ inputCacheArtifact.rpmsTarball }}"
187-
175+
- ${{ each inputCacheRPMsTarball in parameters.inputCacheRPMsTarballs }}:
188176
- script: |
189-
rpms_archive="$(find "$(Pipeline.Workspace)" -name "${{ inputCacheArtifact.rpmsTarball }}" -print -quit)"
177+
rpms_archive="$(find "${{ parameters.inputArtifactsFolder }}" -name "${{ inputCacheRPMsTarball }}" -print -quit)"
190178
if [[ ! -f "$rpms_archive" ]]; then
191-
echo "ERROR: cache RPMs archive '${{ inputCacheArtifact.rpmsTarball }}' not found!" >&2
179+
echo "ERROR: cache RPMs archive '${{ inputCacheRPMsTarball }}' not found!" >&2
192180
exit 1
193181
fi
194182
@@ -200,7 +188,7 @@ steps:
200188
check_build_retries_arg="CHECK_BUILD_RETRIES=${{ parameters.checkBuildRetries }}"
201189
fi
202190
203-
if [[ -n "${{ parameters.customToolchainArtifactName }}" ]]; then
191+
if [[ -n "${{ parameters.customToolchainTarballName }}" ]]; then
204192
toolchain_archive_arg="TOOLCHAIN_ARCHIVE=$(toolchainArchive)"
205193
fi
206194

.pipelines/templatesWithCheckout/SodiffCheck.yml

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@ parameters:
66
type: string
77
default: "$(Build.SourcesDirectory)"
88

9-
- name: inputArtifactName
9+
- name: inputArtifactsFolder
1010
type: string
11+
default: "$(Agent.TempDirectory)"
1112

1213
- name: inputRPMsTarballName
1314
type: string
@@ -26,19 +27,11 @@ parameters:
2627
default: "$(Agent.TempDirectory)/SourcesWorkspace"
2728

2829
steps:
29-
- task: DownloadPipelineArtifact@2
30-
displayName: "Download sources for signing"
31-
inputs:
32-
artifact: ${{ parameters.inputArtifactName }}
33-
patterns: |
34-
**/${{ parameters.inputRPMsTarballName }}
35-
targetPath: "$(Agent.TempDirectory)"
36-
3730
- script: |
3831
set -e
3932
4033
mkdir -p "${{ parameters.sourcesWorkspace }}"
41-
find "$(Agent.TempDirectory)" -name "${{ parameters.inputRPMsTarballName }}" -print0 | xargs -0 -n 1 tar -C "${{ parameters.sourcesWorkspace }}" -xkf
34+
find "${{ parameters.inputArtifactsFolder }}" -name "${{ parameters.inputRPMsTarballName }}" -print0 | xargs -0 -n 1 tar -C "${{ parameters.sourcesWorkspace }}" -xkf
4235
displayName: "Extract sources tarball"
4336
4437
- script: |

0 commit comments

Comments
 (0)