Skip to content

Commit 2d39b96

Browse files
Merge pull request #471 from mr-mosi:flyte
PiperOrigin-RevId: 646422854 Change-Id: If606ca49f8fed8e1f3f0728b46ddbca17ac07a0e
2 parents 3661fed + 2e74ca6 commit 2d39b96

File tree

4 files changed

+5752
-0
lines changed

4 files changed

+5752
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
services:
2+
flyte-console:
3+
image: ghcr.io/flyteorg/flyteconsole-release:${FLYTE_CONSOLE_VERSION}
4+
ports:
5+
- 8080:8080
6+
environment:
7+
BASE_URL: "/console"
8+
CONFIG_DIR: "/etc/flyte/config"
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright 2022 Google LLC
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# https://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
set -e
18+
19+
source ../../common.sh
20+
21+
SCRIPT_PATH="$(cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P)"
22+
# Root path to the web fingerprinter plugin.
23+
PROJECT_ROOT="$(cd -- "${SCRIPT_PATH}/../../../.." >/dev/null 2>&1 ; pwd -P)"
24+
# Path to the configurations for starting a live instance of Flyte.
25+
FLYTE_APP_PATH="${SCRIPT_PATH}/app"
26+
# Path to the temporary data holder.
27+
TMP_DATA="/tmp/FLYTE_fingerprints"
28+
# Path to the local git repository for Flyte codebase.
29+
GIT_REPO="${TMP_DATA}/repo"
30+
# Path to the directory of all the updated fingerprints data.
31+
FINGERPRINTS_PATH="${TMP_DATA}/fingerprints"
32+
# Json data of the final result.
33+
JSON_DATA="${FINGERPRINTS_PATH}/fingerprint.json"
34+
# Binary proto data of the final result.
35+
BIN_DATA="${FINGERPRINTS_PATH}/fingerprint.binproto"
36+
# Read all the versions to be fingerprinted.
37+
readarray -t ALL_VERSIONS < "${SCRIPT_PATH}/versions.txt"
38+
mkdir -p "${FINGERPRINTS_PATH}"
39+
40+
startFlyteConsole() {
41+
local version="$1"
42+
pushd "${FLYTE_APP_PATH}" >/dev/null
43+
FLYTE_CONSOLE_VERSION="${version}" docker compose up -d
44+
popd >/dev/null
45+
}
46+
47+
stopFlyteConsole() {
48+
local version="$1"
49+
pushd "${FLYTE_APP_PATH}" >/dev/null
50+
FLYTE_CONSOLE_VERSION="${version}" docker compose down --volumes --remove-orphans
51+
popd >/dev/null
52+
}
53+
54+
createFingerprintForDashboard() {
55+
local FLYTE_CONSOLE_VERSION="$1"
56+
57+
echo "Fingerprinting Flyte version ${FLYTE_CONSOLE_VERSION} ..."
58+
# Start a live instance of Flyte.
59+
startFlyteConsole "${FLYTE_CONSOLE_VERSION}"
60+
# Arbitrarily chosen so that FlyteFlyte is up and running.
61+
echo "Waiting for Flyte ${FLYTE_CONSOLE_VERSION} to be ready ..."
62+
sleep 10
63+
64+
# Checkout the repository to the correct tag.
65+
checkOutRepo "${GIT_REPO}" "${FLYTE_CONSOLE_VERSION}"
66+
67+
updateFingerprint \
68+
"flyte" \
69+
"${FLYTE_CONSOLE_VERSION}" \
70+
"${FINGERPRINTS_PATH}" \
71+
"${GIT_REPO}/website/console" \
72+
"http://localhost:8080/console/"
73+
74+
# Stop the live instance of Flyte.
75+
stopFlyteConsole "${FLYTE_CONSOLE_VERSION}"
76+
}
77+
78+
79+
# Convert the existing data file to a human-readable json file.
80+
convertFingerprint \
81+
"${PROJECT_ROOT}/src/main/resources/fingerprinters/web/data/community/flyte.binproto" \
82+
"${JSON_DATA}"
83+
84+
# Fetch Flyte codebase.
85+
if [[ ! -d "${GIT_REPO}" ]] ; then
86+
git clone https://github.com/flyteorg/flyteconsole.git "${GIT_REPO}"
87+
fi
88+
89+
# Update for all the versions listed in versions.txt file.
90+
for FLYTE_CONSOLE_VERSION in "${ALL_VERSIONS[@]}"; do
91+
createFingerprintForDashboard "${FLYTE_CONSOLE_VERSION}"
92+
done
93+
94+
convertFingerprint "${JSON_DATA}" "${BIN_DATA}"
95+
96+
echo "Fingerprint updated for Flyte. Please commit the following file:"
97+
echo " ${BIN_DATA}"
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
v1.12.0
2+
v1.11.0
3+
v1.10.0
4+
v1.9.1
5+
v1.9.0
6+
v1.8.1
7+
v1.8.0
8+
v1.7.0
9+
v1.6.2
10+
v1.6.1
11+
v1.6.0
12+
v1.5.1
13+
v1.5.0
14+
v1.4.3
15+
v1.4.2
16+
v1.4.1
17+
v1.4.0
18+
v1.3.0
19+
v1.2.1
20+
v1.2.0
21+
v1.1.6
22+
v1.1.3
23+
v1.1.0
24+
v1.1.1
25+
v1.0.0
26+
v0.19.4

0 commit comments

Comments
 (0)