Skip to content

Commit be0606e

Browse files
shovnikAzfaar Qureshi
andauthored
Migrate CircleCI workflows to GitHub Actions (2/3) (#3341)
* Added integration and integration-config-db jobs to Github Actions workflow Signed-off-by: Azfaar Qureshi <[email protected]> Signed-off-by: Shovnik Bhattacharya <[email protected]> adding table to README and removing vestigial lines from workflow Signed-off-by: Azfaar Qureshi <[email protected]> Added integration and integration-configs-db jobs Signed-off-by: Azfaar Qureshi <[email protected]> reading from cortexproject Signed-off-by: Azfaar Qureshi <[email protected]> Made Step Naming Consistent Signed-off-by: Shovnik Bhattacharya <[email protected]> read tag only if they exist on the push event updating quay image removing old README changing to v2 Addressed changes requested in PR 1/3 * Made changes suggested by pracucci in review Signed-off-by: Shovnik Bhattacharya <[email protected]> * Moved docker installation to script Signed-off-by: Shovnik Bhattacharya <[email protected]> Co-authored-by: Azfaar Qureshi <[email protected]>
1 parent f8b3947 commit be0606e

File tree

3 files changed

+94
-14
lines changed

3 files changed

+94
-14
lines changed

.github/workflows-doc.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,6 @@ As of October 2020, GitHub Actions do not persist between different jobs in the
6262
|-------------------------------|-----------|---------------------------------------------|-----------------------------|
6363
| website public | build | deploy_website | share data between jobs |
6464
| Docker Images | build | deploy, integration, integrations-config-db | share data between jobs |
65-
| Frontend Protobuf | build | | long term storage |
66-
| Caching Index Client Protobuf | build | | long term storage |
67-
| Ring Protobuf | build | | long term storage |
68-
| Rules Protobuf | build | | long term storage |
6965
7066
*Note:* Docker Images are zipped before uploading as a workaround. The images contain characters that are illegal in the upload-artifact action.
7167
```yaml
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
set -x
4+
VER="17.03.0-ce"
5+
curl -L -o /tmp/docker-$VER.tgz https://download.docker.com/linux/static/stable/x86_64/docker-$VER.tgz
6+
tar -xz -C /tmp -f /tmp/docker-$VER.tgz
7+
mv /tmp/docker/* /usr/bin

.github/workflows/test-build-deploy.yml

Lines changed: 87 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55
tags:
66
- v[0-9]+.[0-9]+.[0-9]+** # Tag filters not as strict due to different regex system on Github Actions
77
pull_request:
8+
89
jobs:
910
lint:
1011
runs-on: ubuntu-latest
@@ -13,6 +14,8 @@ jobs:
1314
steps:
1415
- name: Checkout Repo
1516
uses: actions/checkout@v2
17+
# Commands in the Makefile are hardcoded with an assumed file structure of the CI container
18+
# Symlink ensures paths specified in previous commands don’t break
1619
- name: Sym Link Expected Path to Workspace
1720
run: |
1821
mkdir -p /go/src/github.com/cortexproject/cortex
@@ -57,12 +60,7 @@ jobs:
5760
- name: Checkout Repo
5861
uses: actions/checkout@v2
5962
- name: Install Docker Client
60-
run: |
61-
set -x
62-
VER="17.03.0-ce"
63-
curl -L -o /tmp/docker-$VER.tgz https://download.docker.com/linux/static/stable/x86_64/docker-$VER.tgz
64-
tar -xz -C /tmp -f /tmp/docker-$VER.tgz
65-
mv /tmp/docker/* /usr/bin
63+
run: ./.github/workflows/scripts/install-docker.sh
6664
- name: Sym Link Expected Path to Workspace
6765
run: |
6866
mkdir -p /go/src/github.com/cortexproject/cortex
@@ -80,10 +78,89 @@ jobs:
8078
mkdir /tmp/images
8179
ln -s /tmp/images ./docker-images
8280
make BUILD_IN_CONTAINER=false save-images
83-
- name: Zip Images
84-
run: tar -zcvf images.tar.gz /tmp/images
85-
- name: Upload Images Artifact
81+
- name: Create Docker Images Archive
82+
run: tar -cvf images.tar /tmp/images
83+
- name: Upload Docker Images Artifact
8684
uses: actions/upload-artifact@v2
8785
with:
8886
name: Docker Images
89-
path: ./images.tar.gz
87+
path: ./images.tar
88+
89+
integration:
90+
needs: build
91+
runs-on: ubuntu-16.04
92+
steps:
93+
- name: Upgrade golang
94+
run: |
95+
cd /tmp
96+
wget https://dl.google.com/go/go1.14.9.linux-amd64.tar.gz
97+
tar -zxvf go1.14.9.linux-amd64.tar.gz
98+
sudo rm -fr /usr/local/go
99+
sudo mv /tmp/go /usr/local/go
100+
cd -
101+
- name: Checkout Repo
102+
uses: actions/checkout@v2
103+
- name: Install Docker Client
104+
run: sudo ./.github/workflows/scripts/install-docker.sh
105+
- name: Sym Link Expected Path to Workspace
106+
run: |
107+
sudo mkdir -p /go/src/github.com/cortexproject/cortex
108+
sudo ln -s $GITHUB_WORKSPACE/* /go/src/github.com/cortexproject/cortex
109+
- name: Download Docker Images Artifacts
110+
uses: actions/download-artifact@v2
111+
with:
112+
name: Docker Images
113+
- name: Extract Docker Images Archive
114+
run: tar -xvf images.tar -C /
115+
- name: Load Docker Images
116+
run: |
117+
ln -s /tmp/images ./docker-images
118+
make BUILD_IN_CONTAINER=false load-images
119+
- name: Preload Images
120+
# We download docker images used by integration tests so that all images are available
121+
# locally and the download time doesn't account in the test execution time, which is subject
122+
# to a timeout
123+
run: |
124+
docker pull minio/minio:RELEASE.2019-12-30T05-45-39Z
125+
docker pull amazon/dynamodb-local:1.11.477
126+
docker pull consul:0.9
127+
docker pull gcr.io/etcd-development/etcd:v3.4.7
128+
docker pull quay.io/cortexproject/cortex:v1.0.0
129+
docker pull quay.io/cortexproject/cortex:v1.1.0
130+
docker pull quay.io/cortexproject/cortex:v1.2.0
131+
docker pull quay.io/cortexproject/cortex:v1.3.0
132+
docker pull quay.io/cortexproject/cortex:v1.4.0
133+
docker pull shopify/bigtable-emulator:0.1.0
134+
docker pull rinscy/cassandra:3.11.0
135+
docker pull memcached:1.6.1
136+
docker pull bouncestorage/swift-aio:55ba4331
137+
- name: Integration Tests
138+
run: |
139+
export CORTEX_IMAGE_PREFIX="${IMAGE_PREFIX:-quay.io/cortexproject/}"
140+
export CORTEX_IMAGE="${CORTEX_IMAGE_PREFIX}cortex:${TAG:-$(./tools/image-tag)}"
141+
export CORTEX_CHECKOUT_DIR="/go/src/github.com/cortexproject/cortex"
142+
echo "Running integration tests with image: $CORTEX_IMAGE"
143+
go test -tags=requires_docker -timeout 1800s -v -count=1 ./integration/...
144+
env:
145+
IMAGE_PREFIX: ${{ secrets.IMAGE_PREFIX }}
146+
TAG: ${{ github.event.push.tag_name }}
147+
148+
integration-configs-db:
149+
needs: build
150+
runs-on: ubuntu-16.04
151+
steps:
152+
- name: Checkout Repo
153+
uses: actions/checkout@v2
154+
- name: Install Docker Client
155+
run: sudo ./.github/workflows/scripts/install-docker.sh
156+
- name: Download Docker Images Artifact
157+
uses: actions/download-artifact@v2
158+
with:
159+
name: Docker Images
160+
- name: Extract Docker Images Archive
161+
run: tar -xvf images.tar -C /
162+
- name: Run Integration Configs Tests
163+
run: |
164+
touch build-image/.uptodate
165+
MIGRATIONS_DIR=$(pwd)/cmd/cortex/migrations
166+
make BUILD_IMAGE=quay.io/cortexproject/build-image:upgrade-build-image-debian-491e60715-WIP TTY='' configs-integration-test

0 commit comments

Comments
 (0)