-
Notifications
You must be signed in to change notification settings - Fork 0
130 lines (106 loc) · 3.48 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
schedule:
- cron: "0 0 * * *"
defaults:
run:
shell: bash
jobs:
build:
runs-on: ubuntu-latest
container:
image: vespaengine/vespa-build-almalinux-8:latest
steps:
- name: Setup tools
run: |
dnf config-manager --add-repo https://raw.githubusercontent.com/vespa-engine/vespa/master/dist/vespa-engine.repo
LATEST="$(curl -SsL https://api.github.com/repos/sibprogrammer/xq/releases/latest | jq -r '.tag_name')"
curl -sSL -o xq.tar.gz https://github.com/sibprogrammer/xq/releases/latest/download/xq_${LATEST//v/}_linux_amd64.tar.gz
tar -xzf xq.tar.gz
mv xq /usr/local/bin/xq
- name: Get Latest Vespa version
id: vespa-metadata
run: |
VESPA_VERSION=$(curl -sSL https://repo1.maven.org/maven2/com/yahoo/vespa/parent/maven-metadata.xml | \
xq -x '/metadata/versioning/latest')
echo "Using version: $VESPA_VERSION"
echo "version=$VESPA_VERSION" >> $GITHUB_OUTPUT
- name: Configure Git
env:
VESPA_VERSION: ${{ steps.vespa-metadata.outputs.version }}
run: |
git config --global --add safe.directory "$(pwd)"
git config --global user.email "[email protected]"
git config --global user.name "GitHub Actions"
- uses: actions/checkout@v4
- name: build-rpm
env:
VESPA_VERSION: ${{ steps.vespa-metadata.outputs.version }}
run: |
git tag -d "v$VESPA_VERSION" || true
git tag -a "v$VESPA_VERSION" -m "Version $VESPA_VERSION"
mkdir builds
make -f .copr/Makefile rpm outdir=$(pwd)/builds
git status
ls -lA builds
- uses: actions/upload-artifact@v4
with:
name: vespa-rpm
path: builds
retention-days: 1
test:
runs-on: ubuntu-latest
needs:
- build
services:
registry:
image: registry:2
ports:
- 5000:5000
env:
BASE_IMAGE_TAG: "localhost:5000/almalinux-vespa"
ANNBENCH_IMAGE_TAG: "ann-benchmark"
ANNBENCH_REPO_ROOT: "${{ github.workspace }}/ann-benchmarks-repo"
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: vespa-rpm
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
# network=host driver-opt needed to push to local registry
driver-opts: network=host
- name: Build
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: "${{ env.BASE_IMAGE_TAG }}"
cache-from: type=gha
cache-to: type=gha,mode=max
- uses: actions/checkout@v4
with:
repository: erikbern/ann-benchmarks
path: ${{ env.ANNBENCH_REPO_ROOT }}
- name: Build
uses: docker/build-push-action@v6
with:
load: true
context: ${{ env.ANNBENCH_REPO_ROOT }}
file: ${{ env.ANNBENCH_REPO_ROOT }}/ann_benchmarks/algorithms/vespa/Dockerfile
tags: "${{ env.ANNBENCH_IMAGE_TAG }}"
# Replace almalinux with our local image
build-contexts: |
almalinux:8=docker-image://${{ env.BASE_IMAGE_TAG }}:latest
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Test
run: |
echo "No tests. Please add."