forked from soramitsu/soramitsu-iroha
-
Notifications
You must be signed in to change notification settings - Fork 2
142 lines (138 loc) · 4.68 KB
/
iroha2-profiling-image.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
131
132
133
134
135
136
137
138
139
140
141
142
name: I2::Profiling::Publish
on:
push:
tags:
- 'v2*'
workflow_dispatch:
inputs:
BUILD_DEPLOY_IMAGE:
description: "Choose \"true\" to build and push deploy image"
type: choice
required: true
default: 'false'
options:
- true
- false
CHECKOUT_REF:
required: false
default: main
# IROHA2_DOCKERFILE:
# required: true
# default: Dockerfile.glibc
# IROHA2_PROFILE:
# description: "IROHA2_PROFILE_ARG: Leave \"deploy\" to build and push deploy image"
# required: true
# default: deploy
# IROHA2_RUSTFLAGS:
# description: "IROHA2_RUSTFLAGS: Leave empty to build \"deploy\" image"
# required: false
# default:
# IROHA2_FEATURES:
# description: "IROHA2_FEATURES: Leave empty to build \"deploy\" image"
# required: false
# default:
# IROHA2_CARGOFLAGS:
# description: "IROHA2_CARGOFLAGS: Leave empty to build \"deploy\" image"
# required: false
# default:
env:
IROHA2_DOCKERFILE: Dockerfile.glibc
IROHA2_PROFILE: profiling
IROHA2_RUSTFLAGS: -C force-frame-pointers=on
IROHA2_FEATURES: profiling
IROHA2_CARGOFLAGS: -Z build-std
jobs:
registry-profiling-image:
if: ${{ inputs.BUILD_DEPLOY_IMAGE == 'false' }}
runs-on: [self-hosted, Linux, iroha2]
container:
image: hyperledger/iroha2-ci:nightly-2024-04-18
steps:
- uses: actions/checkout@v4
- name: Get the release tag
run: |
RELEASE_VERSION=${{ github.ref_name }}
PREFIX='v'
TAG=${RELEASE_VERSION#$PREFIX}
echo "TAG=$TAG" >>$GITHUB_ENV
- uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to Soramitsu Harbor
uses: docker/login-action@v3
with:
registry: docker.soramitsu.co.jp
username: ${{ secrets.HARBOR_USERNAME }}
password: ${{ secrets.HARBOR_TOKEN }}
- name: Set up Docker Buildx
id: buildx
if: always()
uses: docker/setup-buildx-action@v3
with:
install: true
- name: Build and push iroha2-profiling image
uses: docker/build-push-action@v6
if: always()
with:
push: true
tags: |
hyperledger/iroha:${{ env.TAG }}-${{ env.IROHA2_PROFILE }}
docker.soramitsu.co.jp/iroha2/iroha:${{ env.TAG }}-${{ env.IROHA2_PROFILE }}
labels: commit=${{ github.sha }}
build-args: |
"PROFILE=${{ env.IROHA2_PROFILE }}"
"RUSTFLAGS=${{ env.IROHA2_RUSTFLAGS }}"
"FEATURES=${{ env.IROHA2_FEATURES }}"
"CARGOFLAGS=${{ env.IROHA2_CARGOFLAGS }}"
file: ${{env.IROHA2_DOCKERFILE }}
# This context specification is required
context: .
registry-deploy-image:
if: ${{ inputs.BUILD_DEPLOY_IMAGE == 'true' }}
runs-on: ubuntu-latest #[self-hosted, Linux, iroha2]
container:
image: hyperledger/iroha2-ci:nightly-2024-04-18
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.CHECKOUT_REF }}
- name: Get the release tag
run: |
RELEASE_VERSION=${{ github.ref_name }}
PREFIX='v'
TAG=${RELEASE_VERSION#$PREFIX}
echo "TAG=$TAG" >>$GITHUB_ENV
- uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
# - name: Login to Soramitsu Harbor
# uses: docker/login-action@v3
# with:
# registry: docker.soramitsu.co.jp
# username: ${{ secrets.HARBOR_USERNAME }}
# password: ${{ secrets.HARBOR_TOKEN }}
- name: Set up Docker Buildx
id: buildx
if: always()
uses: docker/setup-buildx-action@v3
with:
install: true
- name: Build and push iroha2-profiling image
uses: docker/build-push-action@v6
if: always()
with:
push: true
tags: |
bastos525/iroha:${{ env.TAG }}-deploy
# docker.soramitsu.co.jp/iroha2/iroha:${{ env.TAG }}-${{ env.IROHA2_PROFILE }}
labels: commit=${{ github.sha }}
# build-args: |
# "PROFILE=deploy"
# "RUSTFLAGS=${{ github.event.inputs.IROHA2_RUSTFLAGS }}"
# "FEATURES=${{ github.event.inputs.IROHA2_FEATURES }}"
# "CARGOFLAGS=${{ github.event.inputs.IROHA2_CARGOFLAGS }}"
file: ${{env.IROHA2_DOCKERFILE }}
# This context specification is required
context: .