From 1ec09acdd8261f4a62c3d7a2db1b7a61d0ee3637 Mon Sep 17 00:00:00 2001 From: Xabier Almazor Date: Tue, 26 Sep 2023 15:00:53 +0200 Subject: [PATCH 01/71] add all changes --- azure-pipelines-devnet.yml | 43 +++++++++++++++++++ .../workloads/config/ui-config.template.yaml | 13 ++++++ deployment/devnet/workloads/ingresses/ui.yaml | 23 ++++++++++ .../devnet/workloads/namespace/namespace.yaml | 7 +++ frontend/Dockerfile.ui | 24 ++++++++--- frontend/skaffold.devnet.template | 24 +++++++++++ frontend/vite.config.ts | 7 +++ 7 files changed, 135 insertions(+), 6 deletions(-) create mode 100644 azure-pipelines-devnet.yml create mode 100644 deployment/devnet/workloads/config/ui-config.template.yaml create mode 100644 deployment/devnet/workloads/ingresses/ui.yaml create mode 100644 deployment/devnet/workloads/namespace/namespace.yaml create mode 100644 frontend/skaffold.devnet.template diff --git a/azure-pipelines-devnet.yml b/azure-pipelines-devnet.yml new file mode 100644 index 000000000..207141572 --- /dev/null +++ b/azure-pipelines-devnet.yml @@ -0,0 +1,43 @@ +trigger: + - develop + +pool: + vmImage: "ubuntu-latest" + +stages: + - stage: build_and_deploy + displayName: Build and Deploy + dependsOn: [] + condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest')) + jobs: + - job: build_and_deploy + displayName: Build Docker images and deploy through Kubernetes + steps: + - script: curl -Lo skaffold https://storage.googleapis.com/skaffold/releases/latest/skaffold-linux-amd64 && sudo install skaffold /usr/local/bin/ + displayName: Install Skaffold + - task: Docker@2 + displayName: Login to Container Registry + inputs: + command: login + containerRegistry: $(CONTAINER_REGISTRY_SERVICE_CONNECTION) + - task: DownloadSecureFile@1 + name: authkey + displayName: "Download Service Account Key" + inputs: + secureFile: web3-agoric.json + retryCount: "2" + - script: gcloud auth activate-service-account web3-agoric-0@web3-335312.iam.gserviceaccount.com --key-file=$(authkey.secureFilePath) + displayName: Activate Service Account + - task: Kubernetes@1 + inputs: + connectionType: "Kubernetes Service Connection" + kubernetesServiceEndpoint: "gke-service-connection" + namespace: "agoric-makefile-automation" + command: "login" + - script: | + cd frontend + export $(grep -v '^#' .env.devnet | xargs) + envsubst < ../deployment/devnet/workloads/config/ui-config.template.yaml > ../deployment/devnet/workloads/config/ui-config.yaml + envsubst < skaffold.devnet.template.yaml > skaffold.devnet.yaml + skaffold run --filename skaffold.devnet.yaml + displayName: Build and push docker images diff --git a/deployment/devnet/workloads/config/ui-config.template.yaml b/deployment/devnet/workloads/config/ui-config.template.yaml new file mode 100644 index 000000000..5a44f6e0b --- /dev/null +++ b/deployment/devnet/workloads/config/ui-config.template.yaml @@ -0,0 +1,13 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: ui +spec: + selector: + matchLabels: + app: ui + template: + spec: + containers: + - name: ui + image: "kread.azurecr.io/frontend:latest" diff --git a/deployment/devnet/workloads/ingresses/ui.yaml b/deployment/devnet/workloads/ingresses/ui.yaml new file mode 100644 index 000000000..06f8b9540 --- /dev/null +++ b/deployment/devnet/workloads/ingresses/ui.yaml @@ -0,0 +1,23 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: ui-devnet + annotations: + kubernetes.io/ingress.class: "nginx" + cert-manager.io/cluster-issuer: "letsencrypt-staging" + nginx.ingress.kubernetes.io/rewrite-target: /$1 + nginx.ingress.kubernetes.io/proxy-body-size: 200m +spec: + ports: + - name: 80-tcp + port: 80 + protocol: TCP + targetPort: 80 + - name: 443-tcp + port: 443 + protocol: TCP + targetPort: 443 + selector: + app: ui + sessionAffinity: None + type: ClusterIP diff --git a/deployment/devnet/workloads/namespace/namespace.yaml b/deployment/devnet/workloads/namespace/namespace.yaml new file mode 100644 index 000000000..ac5c02c29 --- /dev/null +++ b/deployment/devnet/workloads/namespace/namespace.yaml @@ -0,0 +1,7 @@ +--- +apiVersion: v1 +kind: Namespace +metadata: + name: agoric-makefile-automation + + diff --git a/frontend/Dockerfile.ui b/frontend/Dockerfile.ui index dcc6f73c5..bab651bb0 100644 --- a/frontend/Dockerfile.ui +++ b/frontend/Dockerfile.ui @@ -1,4 +1,4 @@ -FROM node:16-alpine as build +FROM node:18-alpine as build RUN apk --no-cache add --update git python3 make g++ @@ -6,10 +6,16 @@ WORKDIR /usr/main/ RUN yarn set version 2 --only-if-needed -ENV GENERATE_SOURCEMAP false +ENV GENERATE_SOURCEMAP true -ARG VITE_DAPP_CONSTANTS_JSON -ENV VITE_DAPP_CONSTANTS_JSON $VITE_DAPP_CONSTANTS_JSON +ARG VITE_RPC +ENV VITE_RPC $VITE_RPC + +ARG VITE_BRIDE_HREF +ENV VITE_BRIDE_HREF $VITE_BRIDE_HREF + +ARG VITE_BASE_URL +ENV VITE_BASE_URL $VITE_BASE_URL COPY .yarnrc.yml ./.yarnrc.yml COPY yarn.lock ./yarn.lock @@ -18,9 +24,14 @@ COPY .yarn/ ./.yarn/ COPY .eslintrc.json ./.eslintrc.json COPY .eslintignore ./.eslintignore +COPY index.html ./index.html + COPY package.json ./package.json + COPY tsconfig.json ./tsconfig.json -COPY config-overrides.js ./config-overrides.js +COPY tsconfig.node.json ./tsconfig.node.json + +COPY vite.config.ts ./vite.config.ts COPY public/ ./public/ COPY src/ ./src/ @@ -33,7 +44,8 @@ FROM nginx:1.21-alpine as run RUN sed -i '/location \//a try_files $uri $uri/ /index.html;' /etc/nginx/conf.d/default.conf -COPY --from=build /usr/main/build/ /usr/share/nginx/html/ +COPY file.json /usr/share/nginx/html/ +COPY --from=build /usr/main/dist/ /usr/share/nginx/html/ EXPOSE 80 diff --git a/frontend/skaffold.devnet.template b/frontend/skaffold.devnet.template new file mode 100644 index 000000000..8760c0903 --- /dev/null +++ b/frontend/skaffold.devnet.template @@ -0,0 +1,24 @@ +apiVersion: skaffold/v2beta27 +kind: Config +metadata: + name: character-builder-ui +build: + tagPolicy: + sha256: {} + local: + concurrency: 0 + push: true + artifacts: + - image: kread.azurecr.io/frontend + docker: + dockerfile: Dockerfile.ui + buildArgs: + VITE_RPC: "emerynet.rpc.agoric.net" # TODO: provide actual value + VITE_BRIDGE_HREF: "" # TODO: provide actual value + VITE_BASE_URL: "kryha.kread.dev" +deploy: + kustomize: + paths: + - ../deployment/devnet/workloads + defaultNamespace: agoric-makefile-automation + diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts index a04f9b508..ca723a2e5 100644 --- a/frontend/vite.config.ts +++ b/frontend/vite.config.ts @@ -2,6 +2,7 @@ import { defineConfig } from "vite"; import react from "@vitejs/plugin-react"; import tsconfigPaths from "vite-tsconfig-paths"; import svgr from "vite-plugin-svgr"; +import { resolve } from "path"; // Import the 'resolve' function // https://vitejs.dev/config/ export default defineConfig({ @@ -21,6 +22,12 @@ export default defineConfig({ svgr(), ], build: { + rollupOptions: { + input: { + main: resolve(__dirname, "index.html"), // Specify the path to your index.html file + }, + }, target: "es2020", }, }); + From 800ff8e87f9b2a25760d9f7e9320e018a0756d9e Mon Sep 17 00:00:00 2001 From: Xabier Almazor Date: Tue, 26 Sep 2023 15:04:37 +0200 Subject: [PATCH 02/71] fix --- .../{skaffold.devnet.template => skaffold.devnet.template.yaml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename frontend/{skaffold.devnet.template => skaffold.devnet.template.yaml} (100%) diff --git a/frontend/skaffold.devnet.template b/frontend/skaffold.devnet.template.yaml similarity index 100% rename from frontend/skaffold.devnet.template rename to frontend/skaffold.devnet.template.yaml From 75e6a15718ba35d08a80c6d526a51cc10fb65ca9 Mon Sep 17 00:00:00 2001 From: Xabier Almazor Date: Tue, 26 Sep 2023 15:07:08 +0200 Subject: [PATCH 03/71] add file.json --- frontend/file.json | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 frontend/file.json diff --git a/frontend/file.json b/frontend/file.json new file mode 100644 index 000000000..b7a31c0f8 --- /dev/null +++ b/frontend/file.json @@ -0,0 +1,5 @@ +{ + "chainName": "agoriclocal", + "rpcAddrs": ["http://35.187.166.92:14343"], + "dappInterJumperBanner": "A Chrome update is affecting some users' dapp-wallet connection. If you're affected by this issue, please use Brave with shields down until the fix completes." +} From 27c19f518d088b2e80b989c706c6da5c7fa64ffa Mon Sep 17 00:00:00 2001 From: Xabier Almazor Date: Tue, 26 Sep 2023 15:49:00 +0200 Subject: [PATCH 04/71] add kustomization.yaml --- deployment/devnet/workloads/kustomization.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 deployment/devnet/workloads/kustomization.yaml diff --git a/deployment/devnet/workloads/kustomization.yaml b/deployment/devnet/workloads/kustomization.yaml new file mode 100644 index 000000000..3974ddfea --- /dev/null +++ b/deployment/devnet/workloads/kustomization.yaml @@ -0,0 +1,8 @@ +bases: + - ../../base +resources: + - namespace/namespace.yaml + - ingresses/ui.yaml +patchesStrategicMerge: + - config/ui-config.yaml +namespace: agoric-makefile-automation From 3f04d51493beb41622ccbf0732a37227b60be136 Mon Sep 17 00:00:00 2001 From: Xabier Almazor Date: Wed, 27 Sep 2023 13:26:25 +0200 Subject: [PATCH 05/71] emerynet on constants --- frontend/src/constants.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/constants.ts b/frontend/src/constants.ts index 4af5d3d2b..3412aeb84 100644 --- a/frontend/src/constants.ts +++ b/frontend/src/constants.ts @@ -151,8 +151,8 @@ export const networkConfigs = { url: "http://localhost:3000/wallet/network-config", }, localDevnet: { - label: "Local Devnet", - url: "https://wallet.agoric.app/wallet/network-config", //"https://wallet.agoric.app/wallet/network-config", + label: "Emerynet", + url: "https://emerynet.rpc.agoric.net/", //"https://wallet.agoric.app/wallet/network-config", }, } as const; From 23158681a9f3634a2229cb3c2814dacc18824ab7 Mon Sep 17 00:00:00 2001 From: Xabier Almazor Date: Wed, 27 Sep 2023 13:28:02 +0200 Subject: [PATCH 06/71] remove non-needed stuff for emerynet --- deployment/devnet/workloads/kustomization.yaml | 1 - frontend/Dockerfile.ui | 1 - frontend/file.json | 5 ----- 3 files changed, 7 deletions(-) delete mode 100644 frontend/file.json diff --git a/deployment/devnet/workloads/kustomization.yaml b/deployment/devnet/workloads/kustomization.yaml index 3974ddfea..3c20e628a 100644 --- a/deployment/devnet/workloads/kustomization.yaml +++ b/deployment/devnet/workloads/kustomization.yaml @@ -2,7 +2,6 @@ bases: - ../../base resources: - namespace/namespace.yaml - - ingresses/ui.yaml patchesStrategicMerge: - config/ui-config.yaml namespace: agoric-makefile-automation diff --git a/frontend/Dockerfile.ui b/frontend/Dockerfile.ui index bab651bb0..004f99b72 100644 --- a/frontend/Dockerfile.ui +++ b/frontend/Dockerfile.ui @@ -44,7 +44,6 @@ FROM nginx:1.21-alpine as run RUN sed -i '/location \//a try_files $uri $uri/ /index.html;' /etc/nginx/conf.d/default.conf -COPY file.json /usr/share/nginx/html/ COPY --from=build /usr/main/dist/ /usr/share/nginx/html/ EXPOSE 80 diff --git a/frontend/file.json b/frontend/file.json deleted file mode 100644 index b7a31c0f8..000000000 --- a/frontend/file.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "chainName": "agoriclocal", - "rpcAddrs": ["http://35.187.166.92:14343"], - "dappInterJumperBanner": "A Chrome update is affecting some users' dapp-wallet connection. If you're affected by this issue, please use Brave with shields down until the fix completes." -} From 037ea8970525040a94413ea7c9396b153c5d57bf Mon Sep 17 00:00:00 2001 From: Xabier Almazor Date: Wed, 27 Sep 2023 14:34:24 +0200 Subject: [PATCH 07/71] update --- frontend/Dockerfile.ui | 3 +++ 1 file changed, 3 insertions(+) diff --git a/frontend/Dockerfile.ui b/frontend/Dockerfile.ui index 004f99b72..ef59c108e 100644 --- a/frontend/Dockerfile.ui +++ b/frontend/Dockerfile.ui @@ -17,6 +17,9 @@ ENV VITE_BRIDE_HREF $VITE_BRIDE_HREF ARG VITE_BASE_URL ENV VITE_BASE_URL $VITE_BASE_URL +ARG PINATA_GATEWAY +ENV PINATA_GATEWAY $PINATA_GATEWAY + COPY .yarnrc.yml ./.yarnrc.yml COPY yarn.lock ./yarn.lock COPY .yarn/ ./.yarn/ From 6f5a9722894997b2a9dd6d75e861d7cb53d04fe4 Mon Sep 17 00:00:00 2001 From: Wietze Date: Wed, 27 Sep 2023 17:27:13 +0200 Subject: [PATCH 08/71] hotfix url --- frontend/src/context/agoric.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/src/context/agoric.tsx b/frontend/src/context/agoric.tsx index 67e4e6b8e..2c75acd60 100644 --- a/frontend/src/context/agoric.tsx +++ b/frontend/src/context/agoric.tsx @@ -213,7 +213,8 @@ export const AgoricStateProvider = (props: ProviderProps): React.ReactElement => return; } try { - const { rpc, chainName } = await fetchChainInfo(networkConfigs.localDevnet.url); + const { rpc, chainName } = await +fetchChainInfo(networkConfigs.emerynet.url); chainStorageWatcher = makeAgoricChainStorageWatcher(rpc, chainName, (e) => { console.error(e); return; From b6f0952f794ea0b242475fd61a9d1973bef50e96 Mon Sep 17 00:00:00 2001 From: CARLOS TRIGO Date: Wed, 27 Sep 2023 18:22:25 +0200 Subject: [PATCH 09/71] quickfix --- frontend/src/context/agoric.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/context/agoric.tsx b/frontend/src/context/agoric.tsx index 62039fa85..cc51afcd3 100644 --- a/frontend/src/context/agoric.tsx +++ b/frontend/src/context/agoric.tsx @@ -162,7 +162,7 @@ export const AgoricStateProvider = (props: ProviderProps): React.ReactElement => }; const fetchInstance = async () => { - const instances = await chainStorageWatcher.queryOnce([Kind.Data, "published.agoricNames.instance"]); + const instances: any = await chainStorageWatcher.queryOnce([Kind.Data, "published.agoricNames.instance"]); const instance = instances.filter((instance: string[]) => instance[0] === KREAD_IDENTIFIER); // TODO: remove publicFacet from state @@ -170,7 +170,7 @@ export const AgoricStateProvider = (props: ProviderProps): React.ReactElement => }; const fetchTokenInfo = async () => { - const agoricNameBrands = await chainStorageWatcher.queryOnce([Kind.Data, "published.agoricNames.brand"]); + const agoricNameBrands: any = await chainStorageWatcher.queryOnce([Kind.Data, "published.agoricNames.brand"]); const payload: TokenInfo = { character: { issuer: undefined, From 21884c60b465eb4614f0c558ed2183e097596dd5 Mon Sep 17 00:00:00 2001 From: Xabier Almazor Date: Thu, 28 Sep 2023 13:46:32 +0200 Subject: [PATCH 10/71] Add network config logic. Default to localhost if no arg supplied --- frontend/Dockerfile.ui | 3 +++ frontend/skaffold.devnet.template.yaml | 1 + frontend/src/constants.ts | 10 +++++----- frontend/src/context/agoric.tsx | 8 ++++++-- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/frontend/Dockerfile.ui b/frontend/Dockerfile.ui index ef59c108e..7a1bd12c5 100644 --- a/frontend/Dockerfile.ui +++ b/frontend/Dockerfile.ui @@ -20,6 +20,9 @@ ENV VITE_BASE_URL $VITE_BASE_URL ARG PINATA_GATEWAY ENV PINATA_GATEWAY $PINATA_GATEWAY +ARG NETWORK_CONFIG +ENV NETWORK_CONFIG $NETWORK_CONFIG + COPY .yarnrc.yml ./.yarnrc.yml COPY yarn.lock ./yarn.lock COPY .yarn/ ./.yarn/ diff --git a/frontend/skaffold.devnet.template.yaml b/frontend/skaffold.devnet.template.yaml index 8760c0903..e5dbc172d 100644 --- a/frontend/skaffold.devnet.template.yaml +++ b/frontend/skaffold.devnet.template.yaml @@ -16,6 +16,7 @@ build: VITE_RPC: "emerynet.rpc.agoric.net" # TODO: provide actual value VITE_BRIDGE_HREF: "" # TODO: provide actual value VITE_BASE_URL: "kryha.kread.dev" + NETWORK_CONFIG: "emerynet" deploy: kustomize: paths: diff --git a/frontend/src/constants.ts b/frontend/src/constants.ts index 978b5cf76..c35798611 100644 --- a/frontend/src/constants.ts +++ b/frontend/src/constants.ts @@ -149,13 +149,13 @@ export const networkConfigs = { localhost: { label: "Local Network", url: "http://localhost:3000/wallet/network-config", - }, - localDevnet: { - label: "Emerynet", - url: "https://emerynet.rpc.agoric.net/", //"https://wallet.agoric.app/wallet/network-config", - }, + } } as const; +export const getNetworkConfig = (networkArg?: string) => { + return networkArg ? networkConfigs[networkArg] : networkConfigs.localhost; +}; + export const localBridgeHref = "http://localhost:3000/wallet/bridge.html" as const; export const prodBridgeHref = "https://wallet.agoric.app/wallet/bridge.html" as const; export const devBridgeHref = "https://main.wallet-app.pages.dev/wallet/bridge.html" as const; diff --git a/frontend/src/context/agoric.tsx b/frontend/src/context/agoric.tsx index cc51afcd3..60b345a45 100644 --- a/frontend/src/context/agoric.tsx +++ b/frontend/src/context/agoric.tsx @@ -2,7 +2,7 @@ import React, { createContext, useContext, useEffect, useReducer, useState } from "react"; import { AgoricDispatch, AgoricState, AgoricStateActions, TokenInfo } from "../interfaces"; import { AgoricKeplrConnectionErrors as Errors, makeAgoricWalletConnection } from "@agoric/web-components"; -import { CHARACTER_IDENTIFIER, IST_IDENTIFIER, ITEM_IDENTIFIER, KREAD_IDENTIFIER, networkConfigs } from "../constants"; +import { CHARACTER_IDENTIFIER, IST_IDENTIFIER, ITEM_IDENTIFIER, KREAD_IDENTIFIER, networkConfigs, getNetworkConfig } from "../constants"; import { fetchChainInfo } from "./util"; import { ChainStorageWatcher, makeAgoricChainStorageWatcher, AgoricChainStoragePathKind as Kind } from "@agoric/rpc"; @@ -206,13 +206,17 @@ export const AgoricStateProvider = (props: ProviderProps): React.ReactElement => dispatch({ type: "SET_TOKEN_INFO", payload }); }; + const startWatching = async () => { if (state.chainStorageWatcher) { console.info("Storagewatcher found, skipping startWatching"); return; } try { - const { rpc, chainName } = await fetchChainInfo(networkConfigs.emerynet.url); + const networkArg = process.env.NETWORK_CONFIG; // Get the environment variable + const networkConfig = getNetworkConfig(networkArg); // Use the function to get the appropriate config + + const { rpc, chainName } = await fetchChainInfo(networkConfig.url); chainStorageWatcher = makeAgoricChainStorageWatcher(rpc, chainName, (e) => { console.error(e); return; From dd879805c0a19fd948927834dc40c6286442d58a Mon Sep 17 00:00:00 2001 From: Xabier Almazor Date: Thu, 28 Sep 2023 13:55:57 +0200 Subject: [PATCH 11/71] Fix naming convention Devnet -> Emerynet --- ...e-pipelines-devnet.yml => azure-pipelines-emerynet.yml | 8 ++++---- .../workloads/config/ui-config.template.yaml | 0 .../{devnet => emerynet}/workloads/ingresses/ui.yaml | 0 .../{devnet => emerynet}/workloads/kustomization.yaml | 0 .../workloads/namespace/namespace.yaml | 0 ...vnet.template.yaml => skaffold.emerynet.template.yaml} | 6 +++--- 6 files changed, 7 insertions(+), 7 deletions(-) rename azure-pipelines-devnet.yml => azure-pipelines-emerynet.yml (81%) rename deployment/{devnet => emerynet}/workloads/config/ui-config.template.yaml (100%) rename deployment/{devnet => emerynet}/workloads/ingresses/ui.yaml (100%) rename deployment/{devnet => emerynet}/workloads/kustomization.yaml (100%) rename deployment/{devnet => emerynet}/workloads/namespace/namespace.yaml (100%) rename frontend/{skaffold.devnet.template.yaml => skaffold.emerynet.template.yaml} (71%) diff --git a/azure-pipelines-devnet.yml b/azure-pipelines-emerynet.yml similarity index 81% rename from azure-pipelines-devnet.yml rename to azure-pipelines-emerynet.yml index 207141572..356a4def9 100644 --- a/azure-pipelines-devnet.yml +++ b/azure-pipelines-emerynet.yml @@ -36,8 +36,8 @@ stages: command: "login" - script: | cd frontend - export $(grep -v '^#' .env.devnet | xargs) - envsubst < ../deployment/devnet/workloads/config/ui-config.template.yaml > ../deployment/devnet/workloads/config/ui-config.yaml - envsubst < skaffold.devnet.template.yaml > skaffold.devnet.yaml - skaffold run --filename skaffold.devnet.yaml + export $(grep -v '^#' .env.emerynet | xargs) + envsubst < ../deployment/emerynet/workloads/config/ui-config.template.yaml > ../deployment/emerynet/workloads/config/ui-config.yaml + envsubst < skaffold.emerynet.template.yaml > skaffold.emerynet.yaml + skaffold run --filename skaffold.emerynet.yaml displayName: Build and push docker images diff --git a/deployment/devnet/workloads/config/ui-config.template.yaml b/deployment/emerynet/workloads/config/ui-config.template.yaml similarity index 100% rename from deployment/devnet/workloads/config/ui-config.template.yaml rename to deployment/emerynet/workloads/config/ui-config.template.yaml diff --git a/deployment/devnet/workloads/ingresses/ui.yaml b/deployment/emerynet/workloads/ingresses/ui.yaml similarity index 100% rename from deployment/devnet/workloads/ingresses/ui.yaml rename to deployment/emerynet/workloads/ingresses/ui.yaml diff --git a/deployment/devnet/workloads/kustomization.yaml b/deployment/emerynet/workloads/kustomization.yaml similarity index 100% rename from deployment/devnet/workloads/kustomization.yaml rename to deployment/emerynet/workloads/kustomization.yaml diff --git a/deployment/devnet/workloads/namespace/namespace.yaml b/deployment/emerynet/workloads/namespace/namespace.yaml similarity index 100% rename from deployment/devnet/workloads/namespace/namespace.yaml rename to deployment/emerynet/workloads/namespace/namespace.yaml diff --git a/frontend/skaffold.devnet.template.yaml b/frontend/skaffold.emerynet.template.yaml similarity index 71% rename from frontend/skaffold.devnet.template.yaml rename to frontend/skaffold.emerynet.template.yaml index e5dbc172d..0e708ed0d 100644 --- a/frontend/skaffold.devnet.template.yaml +++ b/frontend/skaffold.emerynet.template.yaml @@ -13,13 +13,13 @@ build: docker: dockerfile: Dockerfile.ui buildArgs: - VITE_RPC: "emerynet.rpc.agoric.net" # TODO: provide actual value - VITE_BRIDGE_HREF: "" # TODO: provide actual value + VITE_RPC: "emerynet.rpc.agoric.net" + VITE_BRIDGE_HREF: "" VITE_BASE_URL: "kryha.kread.dev" NETWORK_CONFIG: "emerynet" deploy: kustomize: paths: - - ../deployment/devnet/workloads + - ../deployment/emerynet/workloads defaultNamespace: agoric-makefile-automation From 47dc77913c083432cbadcb78ff18a8f57949fa55 Mon Sep 17 00:00:00 2001 From: Xabier Almazor Date: Thu, 28 Sep 2023 14:23:52 +0200 Subject: [PATCH 12/71] revert new logic --- frontend/Dockerfile.ui | 3 --- frontend/skaffold.emerynet.template.yaml | 1 - frontend/src/constants.ts | 10 +++++----- frontend/src/context/agoric.tsx | 8 ++------ 4 files changed, 7 insertions(+), 15 deletions(-) diff --git a/frontend/Dockerfile.ui b/frontend/Dockerfile.ui index 7a1bd12c5..ef59c108e 100644 --- a/frontend/Dockerfile.ui +++ b/frontend/Dockerfile.ui @@ -20,9 +20,6 @@ ENV VITE_BASE_URL $VITE_BASE_URL ARG PINATA_GATEWAY ENV PINATA_GATEWAY $PINATA_GATEWAY -ARG NETWORK_CONFIG -ENV NETWORK_CONFIG $NETWORK_CONFIG - COPY .yarnrc.yml ./.yarnrc.yml COPY yarn.lock ./yarn.lock COPY .yarn/ ./.yarn/ diff --git a/frontend/skaffold.emerynet.template.yaml b/frontend/skaffold.emerynet.template.yaml index 0e708ed0d..80eee9fa6 100644 --- a/frontend/skaffold.emerynet.template.yaml +++ b/frontend/skaffold.emerynet.template.yaml @@ -16,7 +16,6 @@ build: VITE_RPC: "emerynet.rpc.agoric.net" VITE_BRIDGE_HREF: "" VITE_BASE_URL: "kryha.kread.dev" - NETWORK_CONFIG: "emerynet" deploy: kustomize: paths: diff --git a/frontend/src/constants.ts b/frontend/src/constants.ts index c35798611..978b5cf76 100644 --- a/frontend/src/constants.ts +++ b/frontend/src/constants.ts @@ -149,13 +149,13 @@ export const networkConfigs = { localhost: { label: "Local Network", url: "http://localhost:3000/wallet/network-config", - } + }, + localDevnet: { + label: "Emerynet", + url: "https://emerynet.rpc.agoric.net/", //"https://wallet.agoric.app/wallet/network-config", + }, } as const; -export const getNetworkConfig = (networkArg?: string) => { - return networkArg ? networkConfigs[networkArg] : networkConfigs.localhost; -}; - export const localBridgeHref = "http://localhost:3000/wallet/bridge.html" as const; export const prodBridgeHref = "https://wallet.agoric.app/wallet/bridge.html" as const; export const devBridgeHref = "https://main.wallet-app.pages.dev/wallet/bridge.html" as const; diff --git a/frontend/src/context/agoric.tsx b/frontend/src/context/agoric.tsx index 60b345a45..cc51afcd3 100644 --- a/frontend/src/context/agoric.tsx +++ b/frontend/src/context/agoric.tsx @@ -2,7 +2,7 @@ import React, { createContext, useContext, useEffect, useReducer, useState } from "react"; import { AgoricDispatch, AgoricState, AgoricStateActions, TokenInfo } from "../interfaces"; import { AgoricKeplrConnectionErrors as Errors, makeAgoricWalletConnection } from "@agoric/web-components"; -import { CHARACTER_IDENTIFIER, IST_IDENTIFIER, ITEM_IDENTIFIER, KREAD_IDENTIFIER, networkConfigs, getNetworkConfig } from "../constants"; +import { CHARACTER_IDENTIFIER, IST_IDENTIFIER, ITEM_IDENTIFIER, KREAD_IDENTIFIER, networkConfigs } from "../constants"; import { fetchChainInfo } from "./util"; import { ChainStorageWatcher, makeAgoricChainStorageWatcher, AgoricChainStoragePathKind as Kind } from "@agoric/rpc"; @@ -206,17 +206,13 @@ export const AgoricStateProvider = (props: ProviderProps): React.ReactElement => dispatch({ type: "SET_TOKEN_INFO", payload }); }; - const startWatching = async () => { if (state.chainStorageWatcher) { console.info("Storagewatcher found, skipping startWatching"); return; } try { - const networkArg = process.env.NETWORK_CONFIG; // Get the environment variable - const networkConfig = getNetworkConfig(networkArg); // Use the function to get the appropriate config - - const { rpc, chainName } = await fetchChainInfo(networkConfig.url); + const { rpc, chainName } = await fetchChainInfo(networkConfigs.emerynet.url); chainStorageWatcher = makeAgoricChainStorageWatcher(rpc, chainName, (e) => { console.error(e); return; From 6d60a1503e79fc2cecd49f6d40bfb9cf721be4d9 Mon Sep 17 00:00:00 2001 From: Xabier Almazor Date: Thu, 28 Sep 2023 14:29:21 +0200 Subject: [PATCH 13/71] implement revised logic --- frontend/Dockerfile.ui | 3 +++ frontend/skaffold.emerynet.template.yaml | 1 + frontend/src/context/agoric.tsx | 4 +++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/frontend/Dockerfile.ui b/frontend/Dockerfile.ui index ef59c108e..7a1bd12c5 100644 --- a/frontend/Dockerfile.ui +++ b/frontend/Dockerfile.ui @@ -20,6 +20,9 @@ ENV VITE_BASE_URL $VITE_BASE_URL ARG PINATA_GATEWAY ENV PINATA_GATEWAY $PINATA_GATEWAY +ARG NETWORK_CONFIG +ENV NETWORK_CONFIG $NETWORK_CONFIG + COPY .yarnrc.yml ./.yarnrc.yml COPY yarn.lock ./yarn.lock COPY .yarn/ ./.yarn/ diff --git a/frontend/skaffold.emerynet.template.yaml b/frontend/skaffold.emerynet.template.yaml index 80eee9fa6..70a380540 100644 --- a/frontend/skaffold.emerynet.template.yaml +++ b/frontend/skaffold.emerynet.template.yaml @@ -16,6 +16,7 @@ build: VITE_RPC: "emerynet.rpc.agoric.net" VITE_BRIDGE_HREF: "" VITE_BASE_URL: "kryha.kread.dev" + NETWORK_CONFIG: "https://emerynet.agoric.net/network-config" deploy: kustomize: paths: diff --git a/frontend/src/context/agoric.tsx b/frontend/src/context/agoric.tsx index cc51afcd3..db73b5571 100644 --- a/frontend/src/context/agoric.tsx +++ b/frontend/src/context/agoric.tsx @@ -212,7 +212,9 @@ export const AgoricStateProvider = (props: ProviderProps): React.ReactElement => return; } try { - const { rpc, chainName } = await fetchChainInfo(networkConfigs.emerynet.url); + const networkUrl = process.env.NETWORK_CONFIG; // Get the environment variable + // Use the networkUrl directly to fetch data, assuming it contains the URL + const { rpc, chainName } = await fetchChainInfo(networkUrl); chainStorageWatcher = makeAgoricChainStorageWatcher(rpc, chainName, (e) => { console.error(e); return; From 68ad595f89b46fa739e63a5db5d64524542f4e66 Mon Sep 17 00:00:00 2001 From: Xabier Almazor Date: Thu, 28 Sep 2023 14:41:03 +0200 Subject: [PATCH 14/71] Revert "implement revised logic" This reverts commit 6d60a1503e79fc2cecd49f6d40bfb9cf721be4d9. --- frontend/Dockerfile.ui | 3 --- frontend/skaffold.emerynet.template.yaml | 1 - frontend/src/context/agoric.tsx | 4 +--- 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/frontend/Dockerfile.ui b/frontend/Dockerfile.ui index 7a1bd12c5..ef59c108e 100644 --- a/frontend/Dockerfile.ui +++ b/frontend/Dockerfile.ui @@ -20,9 +20,6 @@ ENV VITE_BASE_URL $VITE_BASE_URL ARG PINATA_GATEWAY ENV PINATA_GATEWAY $PINATA_GATEWAY -ARG NETWORK_CONFIG -ENV NETWORK_CONFIG $NETWORK_CONFIG - COPY .yarnrc.yml ./.yarnrc.yml COPY yarn.lock ./yarn.lock COPY .yarn/ ./.yarn/ diff --git a/frontend/skaffold.emerynet.template.yaml b/frontend/skaffold.emerynet.template.yaml index 70a380540..80eee9fa6 100644 --- a/frontend/skaffold.emerynet.template.yaml +++ b/frontend/skaffold.emerynet.template.yaml @@ -16,7 +16,6 @@ build: VITE_RPC: "emerynet.rpc.agoric.net" VITE_BRIDGE_HREF: "" VITE_BASE_URL: "kryha.kread.dev" - NETWORK_CONFIG: "https://emerynet.agoric.net/network-config" deploy: kustomize: paths: diff --git a/frontend/src/context/agoric.tsx b/frontend/src/context/agoric.tsx index db73b5571..cc51afcd3 100644 --- a/frontend/src/context/agoric.tsx +++ b/frontend/src/context/agoric.tsx @@ -212,9 +212,7 @@ export const AgoricStateProvider = (props: ProviderProps): React.ReactElement => return; } try { - const networkUrl = process.env.NETWORK_CONFIG; // Get the environment variable - // Use the networkUrl directly to fetch data, assuming it contains the URL - const { rpc, chainName } = await fetchChainInfo(networkUrl); + const { rpc, chainName } = await fetchChainInfo(networkConfigs.emerynet.url); chainStorageWatcher = makeAgoricChainStorageWatcher(rpc, chainName, (e) => { console.error(e); return; From a5a44d59fc3d2405d7986b5cc7db587401e4f5c6 Mon Sep 17 00:00:00 2001 From: Xabier Almazor Date: Thu, 28 Sep 2023 14:42:02 +0200 Subject: [PATCH 15/71] Add dockerfile and skaffold template changes --- frontend/Dockerfile.ui | 3 +++ frontend/skaffold.emerynet.template.yaml | 1 + 2 files changed, 4 insertions(+) diff --git a/frontend/Dockerfile.ui b/frontend/Dockerfile.ui index ef59c108e..72c8a655e 100644 --- a/frontend/Dockerfile.ui +++ b/frontend/Dockerfile.ui @@ -20,6 +20,9 @@ ENV VITE_BASE_URL $VITE_BASE_URL ARG PINATA_GATEWAY ENV PINATA_GATEWAY $PINATA_GATEWAY +ARG VITE_NETWORK_CONFIG +ENV VITE_NETWORK_CONFIG $VITE_NETWORK_CONFIG + COPY .yarnrc.yml ./.yarnrc.yml COPY yarn.lock ./yarn.lock COPY .yarn/ ./.yarn/ diff --git a/frontend/skaffold.emerynet.template.yaml b/frontend/skaffold.emerynet.template.yaml index 80eee9fa6..70a380540 100644 --- a/frontend/skaffold.emerynet.template.yaml +++ b/frontend/skaffold.emerynet.template.yaml @@ -16,6 +16,7 @@ build: VITE_RPC: "emerynet.rpc.agoric.net" VITE_BRIDGE_HREF: "" VITE_BASE_URL: "kryha.kread.dev" + NETWORK_CONFIG: "https://emerynet.agoric.net/network-config" deploy: kustomize: paths: From fc2ab06019ca814ffa6f8723369b78d28dbef26d Mon Sep 17 00:00:00 2001 From: Xabier Almazor Date: Thu, 28 Sep 2023 14:42:39 +0200 Subject: [PATCH 16/71] NETWORK_CONFIG to VITE_NETWORK_CONFIG --- frontend/skaffold.emerynet.template.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/skaffold.emerynet.template.yaml b/frontend/skaffold.emerynet.template.yaml index 70a380540..5d6dc6336 100644 --- a/frontend/skaffold.emerynet.template.yaml +++ b/frontend/skaffold.emerynet.template.yaml @@ -16,7 +16,7 @@ build: VITE_RPC: "emerynet.rpc.agoric.net" VITE_BRIDGE_HREF: "" VITE_BASE_URL: "kryha.kread.dev" - NETWORK_CONFIG: "https://emerynet.agoric.net/network-config" + VITE_NETWORK_CONFIG: "https://emerynet.agoric.net/network-config" deploy: kustomize: paths: From b8adbb94df4625a15f5e10b0cf71ba094fd4d86c Mon Sep 17 00:00:00 2001 From: Xabier Almazor Telek Date: Fri, 29 Sep 2023 08:31:18 +0000 Subject: [PATCH 17/71] Updated constants.ts --- frontend/src/constants.ts | 34 ---------------------------------- 1 file changed, 34 deletions(-) diff --git a/frontend/src/constants.ts b/frontend/src/constants.ts index 3559e8072..342fa31f0 100644 --- a/frontend/src/constants.ts +++ b/frontend/src/constants.ts @@ -124,41 +124,7 @@ export type InteractionMode = typeof ITEM_MODE | typeof MAIN_MODE | typeof CATEG export const CHARACTER_HEIGHT = 1190.5511 as const; export const CHARACTER_WIDTH = 841.8898 as const; -<<<<<<< HEAD -export const networkConfigs = { - mainnet: { - label: "Agoric Mainnet", - url: "https://main.agoric.net/network-config", - }, - testnet: { - label: "Agoric Testnet", - url: "https://testnet.agoric.net/network-config", - chainId: "agoriclocal", - }, - devnet: { - label: "Agoric Devnet", - url: "https://devnet.agoric.net/network-config", - }, - ollinet: { - label: "Agoric Ollinet", - url: "https://ollinet.agoric.net/network-config", - }, - emerynet: { - label: "Agoric Emerynet", - url: "https://emerynet.agoric.net/network-config", - }, - localhost: { - label: "Local Network", - url: "http://localhost:3000/wallet/network-config", - }, - localDevnet: { - label: "Emerynet", - url: "https://emerynet.rpc.agoric.net/", //"https://wallet.agoric.app/wallet/network-config", - }, -} as const; -======= export const NETWORK_CONFIG = import.meta.env.VITE_NETWORK_CONFIG || ("https://wallet.agoric.app/wallet/network-config" as const); ->>>>>>> 2b9f354c7fd60aa00f176ac8cf9a5384ea593400 export const localBridgeHref = "http://localhost:3000/wallet/bridge.html" as const; export const prodBridgeHref = "https://wallet.agoric.app/wallet/bridge.html" as const; From 1ae144aa565922e36572f4ff6183ef19c308cb67 Mon Sep 17 00:00:00 2001 From: Xabier Almazor Telek Date: Fri, 29 Sep 2023 08:33:42 +0000 Subject: [PATCH 18/71] Update agoric.tsx with develop content --- frontend/src/context/agoric.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/context/agoric.tsx b/frontend/src/context/agoric.tsx index d756bf968..c40924004 100644 --- a/frontend/src/context/agoric.tsx +++ b/frontend/src/context/agoric.tsx @@ -162,7 +162,7 @@ export const AgoricStateProvider = (props: ProviderProps): React.ReactElement => }; const fetchInstance = async () => { - const instances: any = await chainStorageWatcher.queryOnce([Kind.Data, "published.agoricNames.instance"]); + const instances = await chainStorageWatcher.queryOnce([Kind.Data, "published.agoricNames.instance"]); const instance = instances.filter((instance: string[]) => instance[0] === KREAD_IDENTIFIER); // TODO: remove publicFacet from state @@ -170,7 +170,7 @@ export const AgoricStateProvider = (props: ProviderProps): React.ReactElement => }; const fetchTokenInfo = async () => { - const agoricNameBrands: any = await chainStorageWatcher.queryOnce([Kind.Data, "published.agoricNames.brand"]); + const agoricNameBrands = await chainStorageWatcher.queryOnce([Kind.Data, "published.agoricNames.brand"]); const payload: TokenInfo = { character: { issuer: undefined, From 99acc786e2947418c48b19c5bba9b292bbcfcbd9 Mon Sep 17 00:00:00 2001 From: Xabier Almazor Telek Date: Fri, 29 Sep 2023 08:39:06 +0000 Subject: [PATCH 19/71] Updated azure-pipelines-prod.yml --- azure-pipelines-prod.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/azure-pipelines-prod.yml b/azure-pipelines-prod.yml index 48c1a6720..0653f458b 100644 --- a/azure-pipelines-prod.yml +++ b/azure-pipelines-prod.yml @@ -15,6 +15,11 @@ stages: steps: - script: curl -Lo skaffold https://storage.googleapis.com/skaffold/releases/latest/skaffold-linux-amd64 && sudo install skaffold /usr/local/bin/ displayName: Install Skaffold + - task: Docker@2 + displayName: Login to Container Registry + inputs: + command: login + containerRegistry: $(CONTAINER_REGISTRY_SERVICE_CONNECTION) - task: DownloadSecureFile@1 name: authkey displayName: "Download Service Account Key" From 58ca9b80f2b0c7d458c96ff6239854c2d5a226af Mon Sep 17 00:00:00 2001 From: Xabier Almazor Date: Fri, 29 Sep 2023 10:44:43 +0200 Subject: [PATCH 20/71] fix docker url --- deployment/production/workloads/config/ui-config.template.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployment/production/workloads/config/ui-config.template.yaml b/deployment/production/workloads/config/ui-config.template.yaml index d0e03dc07..5a44f6e0b 100644 --- a/deployment/production/workloads/config/ui-config.template.yaml +++ b/deployment/production/workloads/config/ui-config.template.yaml @@ -10,4 +10,4 @@ spec: spec: containers: - name: ui - image: "$DOCKER_REPO:latest" + image: "kread.azurecr.io/frontend:latest" From 3e02c4a4bad745661893f3d9a566173fbe850f38 Mon Sep 17 00:00:00 2001 From: Xabier Almazor Date: Fri, 29 Sep 2023 10:58:32 +0200 Subject: [PATCH 21/71] fix skaffold config for prod --- frontend/skaffold.production.template.yaml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/frontend/skaffold.production.template.yaml b/frontend/skaffold.production.template.yaml index d45056230..c1cbb4370 100644 --- a/frontend/skaffold.production.template.yaml +++ b/frontend/skaffold.production.template.yaml @@ -9,11 +9,14 @@ build: concurrency: 0 push: true artifacts: - - image: $DOCKER_REPO + - image: kread.azurecr.io/frontend docker: dockerfile: Dockerfile.ui buildArgs: - VITE_DAPP_CONSTANTS_JSON: "" # TODO: provide actual value + VITE_RPC: "main.rpc.agoric.net" + VITE_BRIDGE_HREF: "" + VITE_BASE_URL: "kread.app" + VITE_NETWORK_CONFIG: "https://main.agoric.net/network-config" deploy: kustomize: paths: From f42339c92b971571c658234cd6d995b8969cd2d8 Mon Sep 17 00:00:00 2001 From: Wietze Date: Mon, 2 Oct 2023 00:43:47 +0300 Subject: [PATCH 22/71] use gke --- azure-pipelines-prod.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/azure-pipelines-prod.yml b/azure-pipelines-prod.yml index 0653f458b..48c1a6720 100644 --- a/azure-pipelines-prod.yml +++ b/azure-pipelines-prod.yml @@ -15,11 +15,6 @@ stages: steps: - script: curl -Lo skaffold https://storage.googleapis.com/skaffold/releases/latest/skaffold-linux-amd64 && sudo install skaffold /usr/local/bin/ displayName: Install Skaffold - - task: Docker@2 - displayName: Login to Container Registry - inputs: - command: login - containerRegistry: $(CONTAINER_REGISTRY_SERVICE_CONNECTION) - task: DownloadSecureFile@1 name: authkey displayName: "Download Service Account Key" From 36a4e8d45055350b7ae00cf241a474fa69bafe87 Mon Sep 17 00:00:00 2001 From: Wietze Date: Mon, 2 Oct 2023 00:48:57 +0300 Subject: [PATCH 23/71] use gcr --- deployment/production/workloads/config/ui-config.template.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployment/production/workloads/config/ui-config.template.yaml b/deployment/production/workloads/config/ui-config.template.yaml index 5a44f6e0b..08ef460b1 100644 --- a/deployment/production/workloads/config/ui-config.template.yaml +++ b/deployment/production/workloads/config/ui-config.template.yaml @@ -10,4 +10,4 @@ spec: spec: containers: - name: ui - image: "kread.azurecr.io/frontend:latest" + image: "gcr.io/frontend:latest" From 9b29ab3e6bd53cb2eae1b2605bd551f3f815a45c Mon Sep 17 00:00:00 2001 From: Wietze Date: Mon, 2 Oct 2023 00:52:48 +0300 Subject: [PATCH 24/71] update to gcr --- .../production/workloads/config/ui-config.template.yaml | 2 +- frontend/skaffold.production.template.yaml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/deployment/production/workloads/config/ui-config.template.yaml b/deployment/production/workloads/config/ui-config.template.yaml index 08ef460b1..3658c36aa 100644 --- a/deployment/production/workloads/config/ui-config.template.yaml +++ b/deployment/production/workloads/config/ui-config.template.yaml @@ -10,4 +10,4 @@ spec: spec: containers: - name: ui - image: "gcr.io/frontend:latest" + image: "eu.gcr.io/web3-335312/kread/frontend-production/frontend:latest" diff --git a/frontend/skaffold.production.template.yaml b/frontend/skaffold.production.template.yaml index c1cbb4370..c20cfee1c 100644 --- a/frontend/skaffold.production.template.yaml +++ b/frontend/skaffold.production.template.yaml @@ -9,12 +9,12 @@ build: concurrency: 0 push: true artifacts: - - image: kread.azurecr.io/frontend + - image: eu.gcr.io/web3-335312/kread/frontend-production/frontend:latest docker: dockerfile: Dockerfile.ui buildArgs: VITE_RPC: "main.rpc.agoric.net" - VITE_BRIDGE_HREF: "" + VITE_BRIDGE_HREF: "" VITE_BASE_URL: "kread.app" VITE_NETWORK_CONFIG: "https://main.agoric.net/network-config" deploy: From 7f4ecae2303abdf170f8f22ec7584fd5df4a571b Mon Sep 17 00:00:00 2001 From: Wietze Date: Mon, 2 Oct 2023 00:55:09 +0300 Subject: [PATCH 25/71] fix --- frontend/skaffold.production.template.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/skaffold.production.template.yaml b/frontend/skaffold.production.template.yaml index c20cfee1c..8c0ff8525 100644 --- a/frontend/skaffold.production.template.yaml +++ b/frontend/skaffold.production.template.yaml @@ -9,7 +9,7 @@ build: concurrency: 0 push: true artifacts: - - image: eu.gcr.io/web3-335312/kread/frontend-production/frontend:latest + - image: eu.gcr.io/web3-335312/kread/frontend-production/frontend docker: dockerfile: Dockerfile.ui buildArgs: From c269b69e6c1a97b786ddf0bf4c30ab8bfb46e911 Mon Sep 17 00:00:00 2001 From: Xabier Almazor Telek Date: Mon, 2 Oct 2023 07:37:57 +0000 Subject: [PATCH 26/71] Merged PR 4476: Merged PR 4475: Provision error and no chars in marketplace nan error fix Merged PR 4475: Provision error and no chars in marketplace nan error fix --- frontend/src/assets/text/error.ts | 8 +++-- .../pages/connect-wallet/connect-wallet.tsx | 25 +++++++++++++-- frontend/src/pages/shop/characters-shop.tsx | 31 ++++++++++++------- frontend/src/pages/shop/items-shop.tsx | 31 ++++++++++++------- 4 files changed, 67 insertions(+), 28 deletions(-) diff --git a/frontend/src/assets/text/error.ts b/frontend/src/assets/text/error.ts index a349917d4..53e2a0c5e 100644 --- a/frontend/src/assets/text/error.ts +++ b/frontend/src/assets/text/error.ts @@ -12,13 +12,15 @@ export const error = { downloadFailed: "an error occurred while downloading the character", mint: { invalidName: "Name is already taken", - nameTaken: `Name taken`, + nameTaken: "Name taken", title: "Mint failed", - insufficientFunds: (ist: bigint) => `Insufficient funds (current balance: ${uISTToIST(Number(ist))} IST)` + insufficientFunds: (ist: bigint) => `Insufficient funds (current balance: ${uISTToIST(Number(ist))} IST)`, }, youHaveNotEquipped: "Oops..you have not equipped your item!", categoryAlreadyEquipped: { title: (category?: string) => `Oops.. you already have a ${category} item equipped!`, - info: (name?: string, category?: string) => `Unequip ${name} before equiping a new ${category}` + info: (name?: string, category?: string) => `Unequip ${name} before equiping a new ${category}`, }, + provisionError: "provision smart-wallet error", + notEnoughBLD: "you do not have enough BLD to provision the smart-wallet!", } as const; diff --git a/frontend/src/pages/connect-wallet/connect-wallet.tsx b/frontend/src/pages/connect-wallet/connect-wallet.tsx index 705c0e508..bb987050c 100644 --- a/frontend/src/pages/connect-wallet/connect-wallet.tsx +++ b/frontend/src/pages/connect-wallet/connect-wallet.tsx @@ -10,6 +10,7 @@ import { Kado, LoadingPage, MenuText, + NotificationDetail, OnboardingCharacter, Overlay, PrimaryButton, @@ -30,6 +31,7 @@ import { useIsMobile, useOnScreen, useViewport } from "../../hooks"; import { useAgoricContext } from "../../context/agoric"; import { routes } from "../../navigation"; import { ButtonRow } from "../onboarding/styles"; +import { NotificationWrapper } from "../../components/notification-detail/styles"; // TODO: Update to designs, Update stylings @@ -37,11 +39,12 @@ export const ConnectWallet: FC = () => { const [service, _] = useAgoricContext(); const navigate = useNavigate(); const { width, height } = useViewport(); - const [, setIsLoading] = useState(false); + const [isLoading, setIsLoading] = useState(false); const ref = useRef(null); const isConnectButtonVisible = useOnScreen(ref); const isMobile = useIsMobile(breakpoints.tablet); const [showWidget, setShowWidget] = useState(false); + const [showToast, setShowToast] = useState(false); const toggleWidget = () => { setShowWidget(!showWidget); @@ -50,7 +53,12 @@ export const ConnectWallet: FC = () => { const provisionWallet = async () => { setIsLoading(true); - await service.walletConnection.provisionSmartWallet(); + try { + await service.walletConnection.provisionSmartWallet(); + } catch (e) { + setIsLoading(false); + setShowToast(true); + } }; if (!service.walletConnection.address) return ; if (service.walletConnection.smartWalletProvisioned) navigate(routes.character); @@ -63,7 +71,7 @@ export const ConnectWallet: FC = () => { provisionWallet()}> {text.general.activateWallet} - + {isLoading ? : } {text.store.buyAssets} @@ -91,6 +99,17 @@ export const ConnectWallet: FC = () => { + + {showToast && } + + setShowToast(false)} + isError + /> + + ); }; diff --git a/frontend/src/pages/shop/characters-shop.tsx b/frontend/src/pages/shop/characters-shop.tsx index ab639eb26..45ff925fd 100644 --- a/frontend/src/pages/shop/characters-shop.tsx +++ b/frontend/src/pages/shop/characters-shop.tsx @@ -21,17 +21,26 @@ export const CharactersShop: FC = () => { const [character] = useGetCharacterInShopById(selectedId); const assetsCount = characters.length; - // TODO: replace identifier with logo - const metricsData = metrics - ? [ - metrics.amountSold, - metrics.collectionSize, - toTwoDecimals(findMinimumValue(characters.map((x) => uISTToIST(Number(x.sell.price))))), - toTwoDecimals(findAverageValue(characters.map((x) => uISTToIST(Number(x.sell.price))))), - toTwoDecimals(metrics.averageLevel), - toTwoDecimals(metrics.marketplaceAverageLevel), - ] - : []; + let metricsData: any = []; + + if (metrics) { + let charAverage = 0; + let charMinimum = 0; + + if (characters.length != 0) { + charMinimum = findMinimumValue(characters.map((x) => uISTToIST(Number(x.sell.price)))); + charAverage = findAverageValue(characters.map((x) => uISTToIST(Number(x.sell.price)))); + } + + metricsData = [ + metrics.amountSold, + metrics.collectionSize, + toTwoDecimals(charMinimum), + toTwoDecimals(charAverage), + toTwoDecimals(metrics.averageLevel), + toTwoDecimals(metrics.marketplaceAverageLevel), + ]; + } return ( <> diff --git a/frontend/src/pages/shop/items-shop.tsx b/frontend/src/pages/shop/items-shop.tsx index 1fe505549..95db7394c 100644 --- a/frontend/src/pages/shop/items-shop.tsx +++ b/frontend/src/pages/shop/items-shop.tsx @@ -20,17 +20,26 @@ export const ItemsShop: FC = () => { const [item] = useGetItemInShopById(selectedId); const assetsCount = items.length; - // TODO: replace identifier with logo - const metricsData = metrics - ? [ - metrics.amountSold, - metrics.collectionSize, - toTwoDecimals(findMinimumValue(items.map((x) => uISTToIST(Number(x.sell.price))))), - toTwoDecimals(findAverageValue(items.map((x) => uISTToIST(Number(x.sell.price))))), - toTwoDecimals(metrics.averageLevel), - toTwoDecimals(metrics.marketplaceAverageLevel), - ] - : []; + let metricsData: any = []; + + if (metrics) { + let itemAverage = 0; + let itemMinimum = 0; + + if (items.length != 0) { + itemMinimum = findMinimumValue(items.map((x) => uISTToIST(Number(x.sell.price)))); + itemAverage = findAverageValue(items.map((x) => uISTToIST(Number(x.sell.price)))); + } + + metricsData = [ + metrics.amountSold, + metrics.collectionSize, + toTwoDecimals(itemMinimum), + toTwoDecimals(itemAverage), + toTwoDecimals(metrics.averageLevel), + toTwoDecimals(metrics.marketplaceAverageLevel), + ]; + } if (!items) return <>; return ( From d64fd19ab6beb2fbbc55688ff9d0503e8439277b Mon Sep 17 00:00:00 2001 From: Xabier Almazor Telek Date: Mon, 2 Oct 2023 09:47:14 +0000 Subject: [PATCH 27/71] Merged PR 4477: merge dev into emerynet-frontend Related work items: #19840 --- .../asset-card/item-card-inventory.tsx | 2 +- .../asset-card/item-card-market.tsx | 2 +- .../src/components/download-image/styles.ts | 5 +++- frontend/src/context/wallet.tsx | 30 ++++++++++++------- 4 files changed, 25 insertions(+), 14 deletions(-) diff --git a/frontend/src/components/asset-card/item-card-inventory.tsx b/frontend/src/components/asset-card/item-card-inventory.tsx index 372d0bf8d..cb7e93835 100644 --- a/frontend/src/components/asset-card/item-card-inventory.tsx +++ b/frontend/src/components/asset-card/item-card-inventory.tsx @@ -68,7 +68,7 @@ export const ItemCardInventory: FC = ({ item, selectItem }) => { )} - + diff --git a/frontend/src/components/asset-card/item-card-market.tsx b/frontend/src/components/asset-card/item-card-market.tsx index 5fe352eb3..dc3b267ff 100644 --- a/frontend/src/components/asset-card/item-card-market.tsx +++ b/frontend/src/components/asset-card/item-card-market.tsx @@ -43,7 +43,7 @@ export const ItemCardMarket: FC = ({ itemInMarket, selectItemInMarketId } selectItemInMarketId(itemInMarket.id)}> - + diff --git a/frontend/src/components/download-image/styles.ts b/frontend/src/components/download-image/styles.ts index e86646247..29781e5b3 100644 --- a/frontend/src/components/download-image/styles.ts +++ b/frontend/src/components/download-image/styles.ts @@ -50,7 +50,10 @@ export const DownloadWrapper = styled.div` ${({ isOpen }): string => { return isOpen ? ` - position: relative; + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); z-index: 1000; margin: auto; width: max-content; diff --git a/frontend/src/context/wallet.tsx b/frontend/src/context/wallet.tsx index 5e6b33143..43beb692d 100644 --- a/frontend/src/context/wallet.tsx +++ b/frontend/src/context/wallet.tsx @@ -1,6 +1,6 @@ -import React, { createContext, useContext, useState, useEffect } from "react"; +import React, { createContext, useContext, useEffect, useState } from "react"; import { useAgoricState } from "./agoric"; -import { SELL_ITEM_INVITATION, SELL_CHARACTER_INVITATION, IST_IDENTIFIER } from "../constants"; +import { IST_IDENTIFIER, SELL_CHARACTER_INVITATION, SELL_ITEM_INVITATION } from "../constants"; import { watchWalletVstorage } from "../service/storage-node/watch-general"; import { Item, OfferProposal } from "../interfaces"; import { makeAsyncIterableFromNotifier as iterateNotifier } from "@agoric/notifier"; @@ -56,8 +56,8 @@ export const WalletContextProvider = (props: ProviderProps): React.ReactElement return; } - const characterNameList = value.map((char: string)=> char.substring(10)); - + const characterNameList = value.map((char: string) => char.substring(10)); + walletDispatch((prevState) => ({ ...prevState, characterNameList, @@ -68,7 +68,7 @@ export const WalletContextProvider = (props: ProviderProps): React.ReactElement }, ); }; - + const updateStateNonVbank = async (purses: any) => { console.count("๐Ÿ’พ LOADING PURSE CHANGE ๐Ÿ’พ"); @@ -103,8 +103,8 @@ export const WalletContextProvider = (props: ProviderProps): React.ReactElement const updateStateOffers = async (offers: any) => { console.count("๐Ÿ’พ LOADING OFFER CHANGE ๐Ÿ’พ"); - const itemProposals: { give: Object; want: Object }[] = []; - const characterProposals: { give: Object; want: Object }[] = []; + const itemProposals: { give: any; want: any }[] = []; + const characterProposals: { give: any; want: any }[] = []; offers.forEach((offer: any) => { const { proposal: { give, want }, @@ -128,9 +128,9 @@ export const WalletContextProvider = (props: ProviderProps): React.ReactElement const watchVBankAssets = async () => { for await (const status of iterateNotifier(agoric.walletConnection.pursesNotifier)) { - if(status){ - const ist = status.find(({ brandPetname }: any)=> brandPetname===IST_IDENTIFIER); - const istValue = ist.currentAmount.value + if (status) { + const ist = status.find(({ brandPetname }: any) => brandPetname === IST_IDENTIFIER); + const istValue = ist.currentAmount.value; walletDispatch((prevState) => ({ ...prevState, ist: istValue, @@ -150,7 +150,15 @@ export const WalletContextProvider = (props: ProviderProps): React.ReactElement return () => { isCancelled = true; }; - }, [pursesNotifier, walletState.fetched, chainStorageWatcher]); + }, [ + pursesNotifier, + walletState.fetched, + chainStorageWatcher, + tokenInfo, + agoric.contracts.kread.instance, + agoric.walletConnection.pursesNotifier, + walletAddress, + ]); return {props.children}; }; From db6f0b69a80579ddb6c533d5416e82ce83891318 Mon Sep 17 00:00:00 2001 From: Xabier Almazor Telek Date: Tue, 3 Oct 2023 07:30:41 +0000 Subject: [PATCH 28/71] Merged PR 4483: add develop changes Related work items: #19840 --- frontend/src/pages/buy/buy-form.tsx | 2 +- frontend/src/pages/create-character/information.tsx | 2 +- frontend/src/pages/shop/items-shop.tsx | 8 ++++++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/frontend/src/pages/buy/buy-form.tsx b/frontend/src/pages/buy/buy-form.tsx index 310b6a4bf..4cc5e6e33 100644 --- a/frontend/src/pages/buy/buy-form.tsx +++ b/frontend/src/pages/buy/buy-form.tsx @@ -58,7 +58,7 @@ export const BuyForm: FC = ({ data, changeStep, isLoading, onSubmi return ( - {text.mint.theCostsOfMinting} + {text.store.marketplaceFees} diff --git a/frontend/src/pages/create-character/information.tsx b/frontend/src/pages/create-character/information.tsx index 934fe55ff..ba6181290 100644 --- a/frontend/src/pages/create-character/information.tsx +++ b/frontend/src/pages/create-character/information.tsx @@ -103,7 +103,7 @@ export const Information: FC = ({ setData, disabled }) => { {text.mint.theCostsOfMinting} - + {text.mint.next} diff --git a/frontend/src/pages/shop/items-shop.tsx b/frontend/src/pages/shop/items-shop.tsx index 95db7394c..69d8e5449 100644 --- a/frontend/src/pages/shop/items-shop.tsx +++ b/frontend/src/pages/shop/items-shop.tsx @@ -42,6 +42,10 @@ export const ItemsShop: FC = () => { } if (!items) return <>; + + //FIXME: disable hair and perk for now until fixed + const filteredItems = items.filter((entry) => entry.item.category != "hair" && entry.item.category != "perk2"); + return ( <> @@ -51,8 +55,8 @@ export const ItemsShop: FC = () => { Market: {text.param.amountOfItems(assetsCount)} {selectedId && item && setSelectedId(id)} />} - {items.length > 0 ? ( - setSelectedId(id)} /> + {filteredItems.length > 0 ? ( + setSelectedId(id)} /> ) : ( Date: Wed, 4 Oct 2023 11:53:48 +0000 Subject: [PATCH 29/71] Merged PR 4486: merge dev changes Related work items: #19840, #20596 --- frontend/src/context/item-shop-context.tsx | 7 +++++- frontend/src/context/user.tsx | 1 + frontend/src/service/character/inventory.ts | 25 +++++++++++++++++---- frontend/src/service/character/market.ts | 12 ++++++++-- frontend/src/service/transform-character.ts | 1 + 5 files changed, 39 insertions(+), 7 deletions(-) diff --git a/frontend/src/context/item-shop-context.tsx b/frontend/src/context/item-shop-context.tsx index a595050a9..3fe36c9ab 100644 --- a/frontend/src/context/item-shop-context.tsx +++ b/frontend/src/context/item-shop-context.tsx @@ -61,7 +61,12 @@ export const ItemMarketContextProvider = (props: ProviderProps): React.ReactElem const item = marketEntry.asset; return { id: marketEntry.id.toString(), - item: { ...item, image: cidToUrl(item.image), thumbnail: cidToUrl(item.thumbnail) }, + item: { + ...item, + image: cidToUrl(item.image), + thumbnail: cidToUrl(item.thumbnail), + description: item.description.replace(/รขย€ย™/g, "โ€™"), + }, sell: { price: marketEntry.askingPrice.value, platformFee: marketEntry.platformFee.value, diff --git a/frontend/src/context/user.tsx b/frontend/src/context/user.tsx index 8eb7d9376..9c97aeab7 100644 --- a/frontend/src/context/user.tsx +++ b/frontend/src/context/user.tsx @@ -94,6 +94,7 @@ const Reducer = (state: UserContext, action: UserStateActions): UserContext => { item.image = cidToUrl(item.image); item.thumbnail = cidToUrl(item.thumbnail); } + item.description = item.description.replace(/รขย€ย™/g, "โ€™"); return item; }); return { ...state, items, fetched: true }; diff --git a/frontend/src/service/character/inventory.ts b/frontend/src/service/character/inventory.ts index fdf476f3c..f16f7354a 100644 --- a/frontend/src/service/character/inventory.ts +++ b/frontend/src/service/character/inventory.ts @@ -23,7 +23,11 @@ const unequipItem = async ({ item, character, service, callback }: UnequipItem): const wantKey = character.keyId == 2 ? 1 : 2; const characterGive: Character = { ...character, id: Number(character.id), image: urlToCid(character.image) }; const characterWant: Character = { ...character, id: Number(character.id), image: urlToCid(character.image), keyId: wantKey }; - const itemWant: Item = { ...item, image: urlToCid(item.image), thumbnail: urlToCid(item.thumbnail) }; + const itemWant: Item = { + ...item, + image: urlToCid(item.image), + thumbnail: urlToCid(item.thumbnail), + }; const spec = { source: "contract", @@ -51,6 +55,7 @@ const unequipItem = async ({ item, character, service, callback }: UnequipItem): give, }; + service.makeOffer(spec, proposal, undefined, ({ status, data }: { status: string; data: object }) => { if (status === "error") { console.error("Offer error", data); @@ -136,7 +141,11 @@ const equipItem = async ({ item, character, service, callback }: EquipItem): Pro const wantKey = character.keyId == 2 ? 1 : 2; const characterGive: Character = { ...character, id: Number(character.id), image: urlToCid(character.image) }; const characterWant: Character = { ...character, id: Number(character.id), image: urlToCid(character.image), keyId: wantKey }; - const itemGive: Item = { ...item, image: urlToCid(item.image), thumbnail: urlToCid(item.thumbnail) }; + const itemGive: Item = { + ...item, + image: urlToCid(item.image), + thumbnail: urlToCid(item.thumbnail), +}; const spec = { source: "contract", @@ -196,8 +205,16 @@ const swapItems = async ({ giveItem, wantItem, character, service, callback }: S const wantKey = character.keyId == 2 ? 1 : 2; const characterGive: Character = { ...character, id: Number(character.id), image: urlToCid(character.image) }; const characterWant: Character = { ...character, id: Number(character.id), image: urlToCid(character.image), keyId: wantKey }; - const itemGive: Item = { ...giveItem, image: urlToCid(giveItem.image), thumbnail: urlToCid(giveItem.thumbnail) }; - const itemWant: Item = { ...wantItem, image: urlToCid(wantItem.image), thumbnail: urlToCid(wantItem.thumbnail) }; + const itemGive: Item = { + ...giveItem, + image: urlToCid(giveItem.image), + thumbnail: urlToCid(giveItem.thumbnail), +}; + const itemWant: Item = { + ...wantItem, + image: urlToCid(wantItem.image), + thumbnail: urlToCid(wantItem.thumbnail), +}; const spec = { diff --git a/frontend/src/service/character/market.ts b/frontend/src/service/character/market.ts index 77d7e4e46..11bd267c1 100644 --- a/frontend/src/service/character/market.ts +++ b/frontend/src/service/character/market.ts @@ -113,7 +113,11 @@ const sellItem = async ({ item, price, service, callback }: ItemMarketAction): P const instance = service.kreadInstance; const itemBrand = service.itemBrand; - const itemGive: Item = { ...item, image: urlToCid(item.image), thumbnail: urlToCid(item.thumbnail) }; + const itemGive: Item = { + ...item, + image: urlToCid(item.image), + thumbnail: urlToCid(item.thumbnail), +}; const spec = { id: "custom-id", @@ -203,7 +207,11 @@ const sellItemBatch = async ({ itemCollection, pricePerItem, service, callback } const buyItem = async ({ entryId, item, price, service, callback }: ItemMarketAction): Promise => { if (!entryId) return; - const itemWant: Item = { ...item, image: urlToCid(item.image), thumbnail: urlToCid(item.thumbnail) }; + const itemWant: Item = { + ...item, + image: urlToCid(item.image), + thumbnail: urlToCid(item.thumbnail), + }; const instance = service.kreadInstance; const itemBrand = service.itemBrand; diff --git a/frontend/src/service/transform-character.ts b/frontend/src/service/transform-character.ts index cfce055a1..fa8a9728d 100644 --- a/frontend/src/service/transform-character.ts +++ b/frontend/src/service/transform-character.ts @@ -20,6 +20,7 @@ export const extendCharacters = async ( ...copyBag[0], image: cidToUrl(copyBag[0].image), thumbnail: cidToUrl(copyBag[0].thumbnail), + description: copyBag[0].description.replace(/รขย€ย™/g, "โ€™"), equippedTo: character.name, forSale: false, })); From 953c84362df787bba37ebf25e3ccecfafa44edd2 Mon Sep 17 00:00:00 2001 From: Xabier Almazor Date: Wed, 11 Oct 2023 10:47:55 +0200 Subject: [PATCH 30/71] Azure pipelines -> gh actions for Emerynet --- azure-pipelines-emerynet.yml | 94 +++++++++++++++++++----------------- 1 file changed, 51 insertions(+), 43 deletions(-) diff --git a/azure-pipelines-emerynet.yml b/azure-pipelines-emerynet.yml index 356a4def9..66888437c 100644 --- a/azure-pipelines-emerynet.yml +++ b/azure-pipelines-emerynet.yml @@ -1,43 +1,51 @@ -trigger: - - develop - -pool: - vmImage: "ubuntu-latest" - -stages: - - stage: build_and_deploy - displayName: Build and Deploy - dependsOn: [] - condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest')) - jobs: - - job: build_and_deploy - displayName: Build Docker images and deploy through Kubernetes - steps: - - script: curl -Lo skaffold https://storage.googleapis.com/skaffold/releases/latest/skaffold-linux-amd64 && sudo install skaffold /usr/local/bin/ - displayName: Install Skaffold - - task: Docker@2 - displayName: Login to Container Registry - inputs: - command: login - containerRegistry: $(CONTAINER_REGISTRY_SERVICE_CONNECTION) - - task: DownloadSecureFile@1 - name: authkey - displayName: "Download Service Account Key" - inputs: - secureFile: web3-agoric.json - retryCount: "2" - - script: gcloud auth activate-service-account web3-agoric-0@web3-335312.iam.gserviceaccount.com --key-file=$(authkey.secureFilePath) - displayName: Activate Service Account - - task: Kubernetes@1 - inputs: - connectionType: "Kubernetes Service Connection" - kubernetesServiceEndpoint: "gke-service-connection" - namespace: "agoric-makefile-automation" - command: "login" - - script: | - cd frontend - export $(grep -v '^#' .env.emerynet | xargs) - envsubst < ../deployment/emerynet/workloads/config/ui-config.template.yaml > ../deployment/emerynet/workloads/config/ui-config.yaml - envsubst < skaffold.emerynet.template.yaml > skaffold.emerynet.yaml - skaffold run --filename skaffold.emerynet.yaml - displayName: Build and push docker images +name: CI/CD Emerynet + +jobs: + build_and_deploy: + runs-on: ubuntu-latest + + steps: + - name: Checkout Repository + uses: actions/checkout@v2 + + - name: Install Skaffold + run: | + curl -Lo skaffold https://storage.googleapis.com/skaffold/releases/latest/skaffold-linux-amd64 + sudo install skaffold /usr/local/bin/ + shell: bash + + - name: Login to Container Registry + run: docker login -u ${{ secrets.CONTAINER_REGISTRY_USERNAME }} -p ${{ secrets.CONTAINER_REGISTRY_PASSWORD }} + env: + DOCKER_CLI_ACI_SERVER: ${{ secrets.CONTAINER_REGISTRY_SERVER }} + shell: bash + + - name: Download Service Account Key + uses: actions/checkout@v2 + with: + path: ${{ runner.workspace }}/authkey + env: + GCP_AUTH_KEY: ${{ secrets.GCP_AUTH_KEY }} + shell: bash + + - name: Activate Service Account + run: gcloud auth activate-service-account web3-agoric-0@web3-335312.iam.gserviceaccount.com --key-file=$GITHUB_WORKSPACE/authkey/web3-agoric.json + env: + GOOGLE_APPLICATION_CREDENTIALS: $GITHUB_WORKSPACE/authkey/web3-agoric.json + shell: bash + + - name: Login to Kubernetes + uses: azure/k8s-set-context@v1 + with: + kubeconfig: ${{ secrets.KUBECONFIG }} + cluster-context: "gke-service-connection" + namespace: "agoric-makefile-automation" + + - name: Build and push Docker images + run: | + cd frontend + export $(grep -v '^#' .env.emerynet | xargs) + envsubst < ../deployment/emerynet/workloads/config/ui-config.template.yaml > ../deployment/emerynet/workloads/config/ui-config.yaml + envsubst < skaffold.emerynet.template.yaml > skaffold.emerynet.yaml + skaffold run --filename skaffold.emerynet.yaml + shell: bash From 21383fab631c072bfbe2c78a6046762e946a8bd5 Mon Sep 17 00:00:00 2001 From: Xabier Almazor Date: Wed, 11 Oct 2023 11:11:25 +0200 Subject: [PATCH 31/71] changes for emerynet pipelien --- .../workflows/azure-pipelines-emerynet.yml | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) rename azure-pipelines-emerynet.yml => .github/workflows/azure-pipelines-emerynet.yml (75%) diff --git a/azure-pipelines-emerynet.yml b/.github/workflows/azure-pipelines-emerynet.yml similarity index 75% rename from azure-pipelines-emerynet.yml rename to .github/workflows/azure-pipelines-emerynet.yml index 66888437c..c79c450c5 100644 --- a/azure-pipelines-emerynet.yml +++ b/.github/workflows/azure-pipelines-emerynet.yml @@ -14,12 +14,6 @@ jobs: sudo install skaffold /usr/local/bin/ shell: bash - - name: Login to Container Registry - run: docker login -u ${{ secrets.CONTAINER_REGISTRY_USERNAME }} -p ${{ secrets.CONTAINER_REGISTRY_PASSWORD }} - env: - DOCKER_CLI_ACI_SERVER: ${{ secrets.CONTAINER_REGISTRY_SERVER }} - shell: bash - - name: Download Service Account Key uses: actions/checkout@v2 with: @@ -28,10 +22,21 @@ jobs: GCP_AUTH_KEY: ${{ secrets.GCP_AUTH_KEY }} shell: bash - - name: Activate Service Account - run: gcloud auth activate-service-account web3-agoric-0@web3-335312.iam.gserviceaccount.com --key-file=$GITHUB_WORKSPACE/authkey/web3-agoric.json + - name: Set Google Cloud Credentials + run: | + echo "$GCP_AUTH_KEY" > $GITHUB_WORKSPACE/authkey/google-credentials.json + export GOOGLE_APPLICATION_CREDENTIALS="$GITHUB_WORKSPACE/authkey/google-credentials.json" + shell: bash + + - name: Configure Docker to Authenticate with Google Cloud + run: | + gcloud auth configure-docker + shell: bash + + - name: Login to Container Registry + run: docker login -u _json_key -p "$GCP_AUTH_KEY" https://gcr.io env: - GOOGLE_APPLICATION_CREDENTIALS: $GITHUB_WORKSPACE/authkey/web3-agoric.json + DOCKER_CLI_ACI_SERVER: ${{ secrets.CONTAINER_REGISTRY_SERVER }} shell: bash - name: Login to Kubernetes From 8d3788aa4289a8c74f2e0602a082b8f40e82c1a4 Mon Sep 17 00:00:00 2001 From: Xabier Almazor Date: Wed, 11 Oct 2023 11:15:11 +0200 Subject: [PATCH 32/71] modify registry --- deployment/emerynet/workloads/config/ui-config.template.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployment/emerynet/workloads/config/ui-config.template.yaml b/deployment/emerynet/workloads/config/ui-config.template.yaml index 5a44f6e0b..8dc80fbd5 100644 --- a/deployment/emerynet/workloads/config/ui-config.template.yaml +++ b/deployment/emerynet/workloads/config/ui-config.template.yaml @@ -10,4 +10,4 @@ spec: spec: containers: - name: ui - image: "kread.azurecr.io/frontend:latest" + image: "eu.gcr.io/web3-335312/kread/frontend-staging/frontend:latest" \ No newline at end of file From fab0b97c0ac0fab72a540630ea1733263a8c6d85 Mon Sep 17 00:00:00 2001 From: Xabier Almazor Date: Wed, 11 Oct 2023 11:17:03 +0200 Subject: [PATCH 33/71] Update --- .../workflows/azure-pipelines-emerynet.yml | 3 + azure-pipelines-emerynet.yml | 59 +++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 azure-pipelines-emerynet.yml diff --git a/.github/workflows/azure-pipelines-emerynet.yml b/.github/workflows/azure-pipelines-emerynet.yml index c79c450c5..d158caafd 100644 --- a/.github/workflows/azure-pipelines-emerynet.yml +++ b/.github/workflows/azure-pipelines-emerynet.yml @@ -1,5 +1,8 @@ name: CI/CD Emerynet +on: + workflow_dispatch: # Allows manual triggering + jobs: build_and_deploy: runs-on: ubuntu-latest diff --git a/azure-pipelines-emerynet.yml b/azure-pipelines-emerynet.yml new file mode 100644 index 000000000..d158caafd --- /dev/null +++ b/azure-pipelines-emerynet.yml @@ -0,0 +1,59 @@ +name: CI/CD Emerynet + +on: + workflow_dispatch: # Allows manual triggering + +jobs: + build_and_deploy: + runs-on: ubuntu-latest + + steps: + - name: Checkout Repository + uses: actions/checkout@v2 + + - name: Install Skaffold + run: | + curl -Lo skaffold https://storage.googleapis.com/skaffold/releases/latest/skaffold-linux-amd64 + sudo install skaffold /usr/local/bin/ + shell: bash + + - name: Download Service Account Key + uses: actions/checkout@v2 + with: + path: ${{ runner.workspace }}/authkey + env: + GCP_AUTH_KEY: ${{ secrets.GCP_AUTH_KEY }} + shell: bash + + - name: Set Google Cloud Credentials + run: | + echo "$GCP_AUTH_KEY" > $GITHUB_WORKSPACE/authkey/google-credentials.json + export GOOGLE_APPLICATION_CREDENTIALS="$GITHUB_WORKSPACE/authkey/google-credentials.json" + shell: bash + + - name: Configure Docker to Authenticate with Google Cloud + run: | + gcloud auth configure-docker + shell: bash + + - name: Login to Container Registry + run: docker login -u _json_key -p "$GCP_AUTH_KEY" https://gcr.io + env: + DOCKER_CLI_ACI_SERVER: ${{ secrets.CONTAINER_REGISTRY_SERVER }} + shell: bash + + - name: Login to Kubernetes + uses: azure/k8s-set-context@v1 + with: + kubeconfig: ${{ secrets.KUBECONFIG }} + cluster-context: "gke-service-connection" + namespace: "agoric-makefile-automation" + + - name: Build and push Docker images + run: | + cd frontend + export $(grep -v '^#' .env.emerynet | xargs) + envsubst < ../deployment/emerynet/workloads/config/ui-config.template.yaml > ../deployment/emerynet/workloads/config/ui-config.yaml + envsubst < skaffold.emerynet.template.yaml > skaffold.emerynet.yaml + skaffold run --filename skaffold.emerynet.yaml + shell: bash From bf838d6c0d5e0f5e341c084b9ec9869bdc71021d Mon Sep 17 00:00:00 2001 From: Xabier Almazor Date: Wed, 11 Oct 2023 11:20:38 +0200 Subject: [PATCH 34/71] rename workflow --- .github/workflows/azure-pipelines-emerynet.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/azure-pipelines-emerynet.yml b/.github/workflows/azure-pipelines-emerynet.yml index d158caafd..782055a34 100644 --- a/.github/workflows/azure-pipelines-emerynet.yml +++ b/.github/workflows/azure-pipelines-emerynet.yml @@ -1,4 +1,4 @@ -name: CI/CD Emerynet +name: CI CD Emerynet on: workflow_dispatch: # Allows manual triggering From 5ce94eebad7e30f93bffb00a115231646adb6f55 Mon Sep 17 00:00:00 2001 From: Xabier Almazor Date: Wed, 11 Oct 2023 11:25:17 +0200 Subject: [PATCH 35/71] update --- .github/workflows/azure-pipelines-emerynet.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/azure-pipelines-emerynet.yml b/.github/workflows/azure-pipelines-emerynet.yml index 782055a34..7400392b8 100644 --- a/.github/workflows/azure-pipelines-emerynet.yml +++ b/.github/workflows/azure-pipelines-emerynet.yml @@ -1,7 +1,7 @@ name: CI CD Emerynet on: - workflow_dispatch: # Allows manual triggering + push jobs: build_and_deploy: @@ -23,7 +23,6 @@ jobs: path: ${{ runner.workspace }}/authkey env: GCP_AUTH_KEY: ${{ secrets.GCP_AUTH_KEY }} - shell: bash - name: Set Google Cloud Credentials run: | From f86d245493bad0c67924037809d1448a19b4a25a Mon Sep 17 00:00:00 2001 From: Xabier Almazor Date: Wed, 11 Oct 2023 11:39:18 +0200 Subject: [PATCH 36/71] push updates --- .github/workflows/azure-pipelines-emerynet.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/azure-pipelines-emerynet.yml b/.github/workflows/azure-pipelines-emerynet.yml index 7400392b8..57c0a8325 100644 --- a/.github/workflows/azure-pipelines-emerynet.yml +++ b/.github/workflows/azure-pipelines-emerynet.yml @@ -1,7 +1,9 @@ name: CI CD Emerynet on: - push + push: + branches: + - develop jobs: build_and_deploy: @@ -18,15 +20,13 @@ jobs: shell: bash - name: Download Service Account Key - uses: actions/checkout@v2 - with: - path: ${{ runner.workspace }}/authkey - env: - GCP_AUTH_KEY: ${{ secrets.GCP_AUTH_KEY }} + run: | + mkdir -p $GITHUB_WORKSPACE/authkey + echo "${{ secrets.GCP_AUTH_KEY }}" > $GITHUB_WORKSPACE/authkey/google-credentials.json + shell: bash - name: Set Google Cloud Credentials run: | - echo "$GCP_AUTH_KEY" > $GITHUB_WORKSPACE/authkey/google-credentials.json export GOOGLE_APPLICATION_CREDENTIALS="$GITHUB_WORKSPACE/authkey/google-credentials.json" shell: bash @@ -36,7 +36,7 @@ jobs: shell: bash - name: Login to Container Registry - run: docker login -u _json_key -p "$GCP_AUTH_KEY" https://gcr.io + run: docker login -u _json_key -p "$(cat $GITHUB_WORKSPACE/authkey/google-credentials.json)" https://gcr.io env: DOCKER_CLI_ACI_SERVER: ${{ secrets.CONTAINER_REGISTRY_SERVER }} shell: bash From 29c2598dfbffef9fab495b1b01c9783535ac67c8 Mon Sep 17 00:00:00 2001 From: Xabier Almazor Date: Wed, 11 Oct 2023 11:39:55 +0200 Subject: [PATCH 37/71] update --- .github/workflows/azure-pipelines-emerynet.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/azure-pipelines-emerynet.yml b/.github/workflows/azure-pipelines-emerynet.yml index 57c0a8325..a809d32fa 100644 --- a/.github/workflows/azure-pipelines-emerynet.yml +++ b/.github/workflows/azure-pipelines-emerynet.yml @@ -1,9 +1,7 @@ name: CI CD Emerynet on: - push: - branches: - - develop + push jobs: build_and_deploy: From 87141bf1ac52a622f587d4b7637a84eb791e7299 Mon Sep 17 00:00:00 2001 From: Xabier Almazor Date: Wed, 11 Oct 2023 11:41:37 +0200 Subject: [PATCH 38/71] update --- .github/workflows/azure-pipelines-emerynet.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/azure-pipelines-emerynet.yml b/.github/workflows/azure-pipelines-emerynet.yml index a809d32fa..85c6a851e 100644 --- a/.github/workflows/azure-pipelines-emerynet.yml +++ b/.github/workflows/azure-pipelines-emerynet.yml @@ -34,7 +34,7 @@ jobs: shell: bash - name: Login to Container Registry - run: docker login -u _json_key -p "$(cat $GITHUB_WORKSPACE/authkey/google-credentials.json)" https://gcr.io + run: echo "$GCP_AUTH_KEY" | docker login -u _json_key --password-stdin https://gcr.io env: DOCKER_CLI_ACI_SERVER: ${{ secrets.CONTAINER_REGISTRY_SERVER }} shell: bash From 651bfd9578eca6da2c5de625d5721b395423c68e Mon Sep 17 00:00:00 2001 From: Xabier Almazor Date: Wed, 11 Oct 2023 11:43:29 +0200 Subject: [PATCH 39/71] update --- .github/workflows/azure-pipelines-emerynet.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/azure-pipelines-emerynet.yml b/.github/workflows/azure-pipelines-emerynet.yml index 85c6a851e..eb194e177 100644 --- a/.github/workflows/azure-pipelines-emerynet.yml +++ b/.github/workflows/azure-pipelines-emerynet.yml @@ -34,7 +34,8 @@ jobs: shell: bash - name: Login to Container Registry - run: echo "$GCP_AUTH_KEY" | docker login -u _json_key --password-stdin https://gcr.io + run: | + docker login -u _json_key --password-stdin https://gcr.io < $GITHUB_WORKSPACE/authkey/google-credentials.json env: DOCKER_CLI_ACI_SERVER: ${{ secrets.CONTAINER_REGISTRY_SERVER }} shell: bash From e772e90b4c6ef20124efad49b4ef48a007642f5d Mon Sep 17 00:00:00 2001 From: Xabier Almazor Date: Wed, 11 Oct 2023 11:49:05 +0200 Subject: [PATCH 40/71] update --- .../workflows/azure-pipelines-emerynet.yml | 20 +++++-------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/.github/workflows/azure-pipelines-emerynet.yml b/.github/workflows/azure-pipelines-emerynet.yml index eb194e177..fffd720f6 100644 --- a/.github/workflows/azure-pipelines-emerynet.yml +++ b/.github/workflows/azure-pipelines-emerynet.yml @@ -1,4 +1,4 @@ -name: CI CD Emerynet +name: CI/CD Emerynet on: push @@ -17,25 +17,15 @@ jobs: sudo install skaffold /usr/local/bin/ shell: bash - - name: Download Service Account Key - run: | - mkdir -p $GITHUB_WORKSPACE/authkey - echo "${{ secrets.GCP_AUTH_KEY }}" > $GITHUB_WORKSPACE/authkey/google-credentials.json - shell: bash - - - name: Set Google Cloud Credentials - run: | - export GOOGLE_APPLICATION_CREDENTIALS="$GITHUB_WORKSPACE/authkey/google-credentials.json" - shell: bash - - - name: Configure Docker to Authenticate with Google Cloud + - name: Configure Docker and Authenticate with Google Cloud run: | + echo "${{ secrets.GCP_AUTH_KEY }}" > google-credentials.json + gcloud auth activate-service-account web3-agoric-0@web3-335312.iam.gserviceaccount.com --key-file=google-credentials.json gcloud auth configure-docker shell: bash - name: Login to Container Registry - run: | - docker login -u _json_key --password-stdin https://gcr.io < $GITHUB_WORKSPACE/authkey/google-credentials.json + run: docker login -u _json_key -p "$(cat google-credentials.json)" https://gcr.io env: DOCKER_CLI_ACI_SERVER: ${{ secrets.CONTAINER_REGISTRY_SERVER }} shell: bash From 59f67785b302b296345a476b96275b9de66e238d Mon Sep 17 00:00:00 2001 From: Xabier Almazor Date: Wed, 11 Oct 2023 11:51:07 +0200 Subject: [PATCH 41/71] update --- .github/workflows/azure-pipelines-emerynet.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/azure-pipelines-emerynet.yml b/.github/workflows/azure-pipelines-emerynet.yml index fffd720f6..c5a36bf72 100644 --- a/.github/workflows/azure-pipelines-emerynet.yml +++ b/.github/workflows/azure-pipelines-emerynet.yml @@ -20,7 +20,6 @@ jobs: - name: Configure Docker and Authenticate with Google Cloud run: | echo "${{ secrets.GCP_AUTH_KEY }}" > google-credentials.json - gcloud auth activate-service-account web3-agoric-0@web3-335312.iam.gserviceaccount.com --key-file=google-credentials.json gcloud auth configure-docker shell: bash From c0c3ba638d906da4a25fa5cb6c9d13196fc12d81 Mon Sep 17 00:00:00 2001 From: Xabier Almazor Date: Wed, 11 Oct 2023 11:53:04 +0200 Subject: [PATCH 42/71] update --- .github/workflows/azure-pipelines-emerynet.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/azure-pipelines-emerynet.yml b/.github/workflows/azure-pipelines-emerynet.yml index c5a36bf72..dd5d083fe 100644 --- a/.github/workflows/azure-pipelines-emerynet.yml +++ b/.github/workflows/azure-pipelines-emerynet.yml @@ -24,7 +24,8 @@ jobs: shell: bash - name: Login to Container Registry - run: docker login -u _json_key -p "$(cat google-credentials.json)" https://gcr.io + run: | + echo "${{ secrets.GCP_AUTH_KEY }}" | docker login -u _json_key --password-stdin https://gcr.io env: DOCKER_CLI_ACI_SERVER: ${{ secrets.CONTAINER_REGISTRY_SERVER }} shell: bash From 1a9a96471d38b7c151b130b0ad6352fe2b148037 Mon Sep 17 00:00:00 2001 From: Xabier Almazor Date: Wed, 11 Oct 2023 11:55:45 +0200 Subject: [PATCH 43/71] update --- .github/workflows/azure-pipelines-emerynet.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/azure-pipelines-emerynet.yml b/.github/workflows/azure-pipelines-emerynet.yml index dd5d083fe..4fa4630c5 100644 --- a/.github/workflows/azure-pipelines-emerynet.yml +++ b/.github/workflows/azure-pipelines-emerynet.yml @@ -30,6 +30,7 @@ jobs: DOCKER_CLI_ACI_SERVER: ${{ secrets.CONTAINER_REGISTRY_SERVER }} shell: bash + - name: Login to Kubernetes uses: azure/k8s-set-context@v1 with: From 0e25716eaf29e0d3cbccd52dc1687bb8a7fb955e Mon Sep 17 00:00:00 2001 From: Xabier Almazor Date: Wed, 11 Oct 2023 12:24:48 +0200 Subject: [PATCH 44/71] update --- .github/workflows/azure-pipelines-emerynet.yml | 14 +++----------- alternate-key.json | 1 + 2 files changed, 4 insertions(+), 11 deletions(-) create mode 100644 alternate-key.json diff --git a/.github/workflows/azure-pipelines-emerynet.yml b/.github/workflows/azure-pipelines-emerynet.yml index 4fa4630c5..eb8425237 100644 --- a/.github/workflows/azure-pipelines-emerynet.yml +++ b/.github/workflows/azure-pipelines-emerynet.yml @@ -17,20 +17,12 @@ jobs: sudo install skaffold /usr/local/bin/ shell: bash - - name: Configure Docker and Authenticate with Google Cloud + - name: Login to Container Registry run: | - echo "${{ secrets.GCP_AUTH_KEY }}" > google-credentials.json - gcloud auth configure-docker + echo "${{ secrets.GCP_AUTH_KEY }}" > web3-335312-5f8a650f4992.json + docker login -u _json_key --password-stdin https://gcr.io < web3-335312-5f8a650f4992.json shell: bash - - name: Login to Container Registry - run: | - echo "${{ secrets.GCP_AUTH_KEY }}" | docker login -u _json_key --password-stdin https://gcr.io - env: - DOCKER_CLI_ACI_SERVER: ${{ secrets.CONTAINER_REGISTRY_SERVER }} - shell: bash - - - name: Login to Kubernetes uses: azure/k8s-set-context@v1 with: diff --git a/alternate-key.json b/alternate-key.json new file mode 100644 index 000000000..a1b6eb432 --- /dev/null +++ b/alternate-key.json @@ -0,0 +1 @@ +5f8a650f499218c51250d3653908d927493c3a20 From 3707864366227faa20148d6a8036c95afc0f5da3 Mon Sep 17 00:00:00 2001 From: Xabier Almazor Date: Wed, 11 Oct 2023 12:25:00 +0200 Subject: [PATCH 45/71] update --- alternate-key.json | 1 - 1 file changed, 1 deletion(-) delete mode 100644 alternate-key.json diff --git a/alternate-key.json b/alternate-key.json deleted file mode 100644 index a1b6eb432..000000000 --- a/alternate-key.json +++ /dev/null @@ -1 +0,0 @@ -5f8a650f499218c51250d3653908d927493c3a20 From 987eb3840235aefc7b70a0d4aeaa09880251ebb4 Mon Sep 17 00:00:00 2001 From: Xabier Almazor Date: Wed, 11 Oct 2023 12:34:34 +0200 Subject: [PATCH 46/71] update --- .github/workflows/azure-pipelines-emerynet.yml | 11 ++++++----- test.json | 1 + 2 files changed, 7 insertions(+), 5 deletions(-) create mode 100644 test.json diff --git a/.github/workflows/azure-pipelines-emerynet.yml b/.github/workflows/azure-pipelines-emerynet.yml index eb8425237..16d61388a 100644 --- a/.github/workflows/azure-pipelines-emerynet.yml +++ b/.github/workflows/azure-pipelines-emerynet.yml @@ -17,11 +17,12 @@ jobs: sudo install skaffold /usr/local/bin/ shell: bash - - name: Login to Container Registry - run: | - echo "${{ secrets.GCP_AUTH_KEY }}" > web3-335312-5f8a650f4992.json - docker login -u _json_key --password-stdin https://gcr.io < web3-335312-5f8a650f4992.json - shell: bash + - name: Login to GCR + uses: docker/login-action@v3 + with: + registry: gcr.io + username: _json_key + password: ${{ secrets.GCP_AUTH_KEY }} - name: Login to Kubernetes uses: azure/k8s-set-context@v1 diff --git a/test.json b/test.json new file mode 100644 index 000000000..a1b6eb432 --- /dev/null +++ b/test.json @@ -0,0 +1 @@ +5f8a650f499218c51250d3653908d927493c3a20 From b6f552a6d899de40bf5c10d6ec3b5962bb082e93 Mon Sep 17 00:00:00 2001 From: Xabier Almazor Date: Wed, 11 Oct 2023 12:34:40 +0200 Subject: [PATCH 47/71] Update --- test.json | 1 - 1 file changed, 1 deletion(-) delete mode 100644 test.json diff --git a/test.json b/test.json deleted file mode 100644 index a1b6eb432..000000000 --- a/test.json +++ /dev/null @@ -1 +0,0 @@ -5f8a650f499218c51250d3653908d927493c3a20 From 2e732a15e0451173231533144d23dd61c3ae8983 Mon Sep 17 00:00:00 2001 From: Xabier Almazor Date: Wed, 11 Oct 2023 12:35:44 +0200 Subject: [PATCH 48/71] fi --- .github/workflows/azure-pipelines-emerynet.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/azure-pipelines-emerynet.yml b/.github/workflows/azure-pipelines-emerynet.yml index 16d61388a..1ea5f0a29 100644 --- a/.github/workflows/azure-pipelines-emerynet.yml +++ b/.github/workflows/azure-pipelines-emerynet.yml @@ -18,11 +18,11 @@ jobs: shell: bash - name: Login to GCR - uses: docker/login-action@v3 - with: - registry: gcr.io - username: _json_key - password: ${{ secrets.GCP_AUTH_KEY }} + uses: docker/login-action@v3 + with: + registry: gcr.io + username: _json_key + password: ${{ secrets.GCP_AUTH_KEY }} - name: Login to Kubernetes uses: azure/k8s-set-context@v1 From a7d402b63a200c8e717e55de06f0dda0289dbfcf Mon Sep 17 00:00:00 2001 From: Xabier Almazor Date: Wed, 11 Oct 2023 12:41:24 +0200 Subject: [PATCH 49/71] fix --- frontend/skaffold.emerynet.template.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/skaffold.emerynet.template.yaml b/frontend/skaffold.emerynet.template.yaml index 5d6dc6336..b723592fa 100644 --- a/frontend/skaffold.emerynet.template.yaml +++ b/frontend/skaffold.emerynet.template.yaml @@ -9,7 +9,7 @@ build: concurrency: 0 push: true artifacts: - - image: kread.azurecr.io/frontend + - image: eu.gcr.io/web3-335312/kread/frontend-staging/frontend docker: dockerfile: Dockerfile.ui buildArgs: From 751563887ffc725f73185ad5a45c1dab028fa95d Mon Sep 17 00:00:00 2001 From: Xabier Almazor Date: Wed, 11 Oct 2023 12:49:07 +0200 Subject: [PATCH 50/71] fix login --- .github/workflows/azure-pipelines-emerynet.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/azure-pipelines-emerynet.yml b/.github/workflows/azure-pipelines-emerynet.yml index 1ea5f0a29..9527e00d4 100644 --- a/.github/workflows/azure-pipelines-emerynet.yml +++ b/.github/workflows/azure-pipelines-emerynet.yml @@ -20,7 +20,7 @@ jobs: - name: Login to GCR uses: docker/login-action@v3 with: - registry: gcr.io + registry: eu.gcr.io username: _json_key password: ${{ secrets.GCP_AUTH_KEY }} From ce869fdb420dfcb05d0a5ca6cd11e503d8d61e87 Mon Sep 17 00:00:00 2001 From: Xabier Almazor Date: Wed, 11 Oct 2023 12:57:35 +0200 Subject: [PATCH 51/71] update --- .github/workflows/azure-pipelines-emerynet.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/azure-pipelines-emerynet.yml b/.github/workflows/azure-pipelines-emerynet.yml index 9527e00d4..553c02240 100644 --- a/.github/workflows/azure-pipelines-emerynet.yml +++ b/.github/workflows/azure-pipelines-emerynet.yml @@ -17,6 +17,16 @@ jobs: sudo install skaffold /usr/local/bin/ shell: bash + - name: Authenticate with Google Cloud + uses: google-github-actions/setup-gcloud@v0 + with: + service_account_key: ${{ secrets.GCP_AUTH_KEY }} + project_id: web3-335312 + export_default_credentials: true + + - name: Activate Service Account + run: gcloud auth activate-service-account github-actions-187@web3-335312.iam.gserviceaccount.com --key-file=$GOOGLE_APPLICATION_CREDENTIALS + - name: Login to GCR uses: docker/login-action@v3 with: From 5492f93e880789179303e5b4779e9ae513e6a403 Mon Sep 17 00:00:00 2001 From: Xabier Almazor Date: Wed, 11 Oct 2023 13:08:30 +0200 Subject: [PATCH 52/71] trigger again --- .github/workflows/azure-pipelines-emerynet.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/azure-pipelines-emerynet.yml b/.github/workflows/azure-pipelines-emerynet.yml index 553c02240..d260e21a4 100644 --- a/.github/workflows/azure-pipelines-emerynet.yml +++ b/.github/workflows/azure-pipelines-emerynet.yml @@ -23,7 +23,7 @@ jobs: service_account_key: ${{ secrets.GCP_AUTH_KEY }} project_id: web3-335312 export_default_credentials: true - + - name: Activate Service Account run: gcloud auth activate-service-account github-actions-187@web3-335312.iam.gserviceaccount.com --key-file=$GOOGLE_APPLICATION_CREDENTIALS @@ -49,3 +49,4 @@ jobs: envsubst < skaffold.emerynet.template.yaml > skaffold.emerynet.yaml skaffold run --filename skaffold.emerynet.yaml shell: bash + \ No newline at end of file From 4079e8d36250bc56a635a2436b1d362fd8634b16 Mon Sep 17 00:00:00 2001 From: Xabier Almazor Date: Wed, 11 Oct 2023 13:15:09 +0200 Subject: [PATCH 53/71] fix content for emerynet --- .github/workflows/azure-pipelines-emerynet.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/azure-pipelines-emerynet.yml b/.github/workflows/azure-pipelines-emerynet.yml index d260e21a4..326466b6e 100644 --- a/.github/workflows/azure-pipelines-emerynet.yml +++ b/.github/workflows/azure-pipelines-emerynet.yml @@ -38,7 +38,7 @@ jobs: uses: azure/k8s-set-context@v1 with: kubeconfig: ${{ secrets.KUBECONFIG }} - cluster-context: "gke-service-connection" + cluster-context: "gke_web3-335312_europe-west1-b_web3-staging" namespace: "agoric-makefile-automation" - name: Build and push Docker images From 8a1f4bede38a9f8426d9aa4fe76c1d34bb03befb Mon Sep 17 00:00:00 2001 From: Xabier Almazor Date: Wed, 11 Oct 2023 13:26:31 +0200 Subject: [PATCH 54/71] update --- .github/workflows/azure-pipelines-emerynet.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/azure-pipelines-emerynet.yml b/.github/workflows/azure-pipelines-emerynet.yml index 326466b6e..8a0a41113 100644 --- a/.github/workflows/azure-pipelines-emerynet.yml +++ b/.github/workflows/azure-pipelines-emerynet.yml @@ -11,10 +11,11 @@ jobs: - name: Checkout Repository uses: actions/checkout@v2 - - name: Install Skaffold + - name: Install Skaffold + GKE Auth Plugin run: | curl -Lo skaffold https://storage.googleapis.com/skaffold/releases/latest/skaffold-linux-amd64 sudo install skaffold /usr/local/bin/ + apt-get -y install google-cloud-sdk-gke-gcloud-auth-plugin shell: bash - name: Authenticate with Google Cloud From cb9121e462d4416114a86645136b155d14b27ddb Mon Sep 17 00:00:00 2001 From: Xabier Almazor Date: Wed, 11 Oct 2023 13:27:26 +0200 Subject: [PATCH 55/71] fix --- .github/workflows/azure-pipelines-emerynet.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/azure-pipelines-emerynet.yml b/.github/workflows/azure-pipelines-emerynet.yml index 8a0a41113..4c02b5104 100644 --- a/.github/workflows/azure-pipelines-emerynet.yml +++ b/.github/workflows/azure-pipelines-emerynet.yml @@ -15,7 +15,7 @@ jobs: run: | curl -Lo skaffold https://storage.googleapis.com/skaffold/releases/latest/skaffold-linux-amd64 sudo install skaffold /usr/local/bin/ - apt-get -y install google-cloud-sdk-gke-gcloud-auth-plugin + sudo apt-get -y install google-cloud-sdk-gke-gcloud-auth-plugin shell: bash - name: Authenticate with Google Cloud From df780fcf33d5d7f4f3d0b9a037434db1f7e31bde Mon Sep 17 00:00:00 2001 From: Xabier Almazor Date: Wed, 11 Oct 2023 13:30:17 +0200 Subject: [PATCH 56/71] update --- .github/workflows/azure-pipelines-emerynet.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/azure-pipelines-emerynet.yml b/.github/workflows/azure-pipelines-emerynet.yml index 4c02b5104..15201078b 100644 --- a/.github/workflows/azure-pipelines-emerynet.yml +++ b/.github/workflows/azure-pipelines-emerynet.yml @@ -15,7 +15,7 @@ jobs: run: | curl -Lo skaffold https://storage.googleapis.com/skaffold/releases/latest/skaffold-linux-amd64 sudo install skaffold /usr/local/bin/ - sudo apt-get -y install google-cloud-sdk-gke-gcloud-auth-plugin + sudo apt-get update -y && apt-get -y install google-cloud-sdk-gke-gcloud-auth-plugin shell: bash - name: Authenticate with Google Cloud From dde169478cd9748d627c0d1a0eafe72bd03f0097 Mon Sep 17 00:00:00 2001 From: Xabier Almazor Date: Wed, 11 Oct 2023 13:31:33 +0200 Subject: [PATCH 57/71] update --- .github/workflows/azure-pipelines-emerynet.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/azure-pipelines-emerynet.yml b/.github/workflows/azure-pipelines-emerynet.yml index 15201078b..49488735a 100644 --- a/.github/workflows/azure-pipelines-emerynet.yml +++ b/.github/workflows/azure-pipelines-emerynet.yml @@ -15,7 +15,7 @@ jobs: run: | curl -Lo skaffold https://storage.googleapis.com/skaffold/releases/latest/skaffold-linux-amd64 sudo install skaffold /usr/local/bin/ - sudo apt-get update -y && apt-get -y install google-cloud-sdk-gke-gcloud-auth-plugin + sudo apt-get update -y && sudo apt-get -y install google-cloud-sdk-gke-gcloud-auth-plugin shell: bash - name: Authenticate with Google Cloud From 6c7c0d7b1fb5d8f9bbb2f0f85ea47326a9908079 Mon Sep 17 00:00:00 2001 From: Xabier Almazor Date: Wed, 11 Oct 2023 13:39:46 +0200 Subject: [PATCH 58/71] update --- .github/workflows/azure-pipelines-emerynet.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/azure-pipelines-emerynet.yml b/.github/workflows/azure-pipelines-emerynet.yml index 49488735a..4de5fa0b0 100644 --- a/.github/workflows/azure-pipelines-emerynet.yml +++ b/.github/workflows/azure-pipelines-emerynet.yml @@ -15,7 +15,6 @@ jobs: run: | curl -Lo skaffold https://storage.googleapis.com/skaffold/releases/latest/skaffold-linux-amd64 sudo install skaffold /usr/local/bin/ - sudo apt-get update -y && sudo apt-get -y install google-cloud-sdk-gke-gcloud-auth-plugin shell: bash - name: Authenticate with Google Cloud @@ -25,8 +24,10 @@ jobs: project_id: web3-335312 export_default_credentials: true - - name: Activate Service Account - run: gcloud auth activate-service-account github-actions-187@web3-335312.iam.gserviceaccount.com --key-file=$GOOGLE_APPLICATION_CREDENTIALS + - name: Activate Service Account + Install GKE Plugin + run: | + gcloud auth activate-service-account github-actions-187@web3-335312.iam.gserviceaccount.com --key-file=$GOOGLE_APPLICATION_CREDENTIALS + gcloud components install gke-gcloud-auth-plugin - name: Login to GCR uses: docker/login-action@v3 From f5242241219ffb7e84b61fb9834403aadfbcad2b Mon Sep 17 00:00:00 2001 From: Xabier Almazor Date: Wed, 11 Oct 2023 13:52:32 +0200 Subject: [PATCH 59/71] dd workflow dispatch --- .github/workflows/azure-pipelines-emerynet.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/azure-pipelines-emerynet.yml b/.github/workflows/azure-pipelines-emerynet.yml index 4de5fa0b0..30da0c3a5 100644 --- a/.github/workflows/azure-pipelines-emerynet.yml +++ b/.github/workflows/azure-pipelines-emerynet.yml @@ -1,7 +1,7 @@ name: CI/CD Emerynet on: - push + workflow_dispatch jobs: build_and_deploy: From 5adf2bc4bad057d6a4bfe39d1871d49127851cda Mon Sep 17 00:00:00 2001 From: Xabier Almazor Date: Wed, 11 Oct 2023 13:55:29 +0200 Subject: [PATCH 60/71] update --- .github/workflows/azure-pipelines-emerynet.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/azure-pipelines-emerynet.yml b/.github/workflows/azure-pipelines-emerynet.yml index 30da0c3a5..88760abe6 100644 --- a/.github/workflows/azure-pipelines-emerynet.yml +++ b/.github/workflows/azure-pipelines-emerynet.yml @@ -1,7 +1,7 @@ name: CI/CD Emerynet on: - workflow_dispatch + workflow_dispatch: jobs: build_and_deploy: From 75b508280832af482c312f087565cb3e5dcd3aa7 Mon Sep 17 00:00:00 2001 From: Xabier Almazor Date: Wed, 11 Oct 2023 14:21:53 +0200 Subject: [PATCH 61/71] add mainnet pipeline --- ...s-emerynet.yml => kread-emerynet-cicd.yml} | 6 +- .github/workflows/kread-mainnet-cicd.yml | 58 ++++++++++++++++++ azure-pipelines-emerynet.yml | 59 ------------------- azure-pipelines-prod.yml | 38 ------------ azure-pipelines.old.yml | 58 ------------------ azure-pipelines.yml | 38 ------------ 6 files changed, 63 insertions(+), 194 deletions(-) rename .github/workflows/{azure-pipelines-emerynet.yml => kread-emerynet-cicd.yml} (96%) create mode 100644 .github/workflows/kread-mainnet-cicd.yml delete mode 100644 azure-pipelines-emerynet.yml delete mode 100644 azure-pipelines-prod.yml delete mode 100644 azure-pipelines.old.yml delete mode 100644 azure-pipelines.yml diff --git a/.github/workflows/azure-pipelines-emerynet.yml b/.github/workflows/kread-emerynet-cicd.yml similarity index 96% rename from .github/workflows/azure-pipelines-emerynet.yml rename to .github/workflows/kread-emerynet-cicd.yml index 88760abe6..533eb40a6 100644 --- a/.github/workflows/azure-pipelines-emerynet.yml +++ b/.github/workflows/kread-emerynet-cicd.yml @@ -1,7 +1,11 @@ name: CI/CD Emerynet on: - workflow_dispatch: + pull_request: + branches: + - develop + types: + - closed jobs: build_and_deploy: diff --git a/.github/workflows/kread-mainnet-cicd.yml b/.github/workflows/kread-mainnet-cicd.yml new file mode 100644 index 000000000..6d437612f --- /dev/null +++ b/.github/workflows/kread-mainnet-cicd.yml @@ -0,0 +1,58 @@ +name: CI/CD Mainnet + +on: + pull_request: + branches: + - main + types: + - closed + +jobs: + build_and_deploy: + runs-on: ubuntu-latest + + steps: + - name: Checkout Repository + uses: actions/checkout@v2 + + - name: Install Skaffold + GKE Auth Plugin + run: | + curl -Lo skaffold https://storage.googleapis.com/skaffold/releases/latest/skaffold-linux-amd64 + sudo install skaffold /usr/local/bin/ + shell: bash + + - name: Authenticate with Google Cloud + uses: google-github-actions/setup-gcloud@v0 + with: + service_account_key: ${{ secrets.GCP_AUTH_KEY }} + project_id: web3-335312 + export_default_credentials: true + + - name: Activate Service Account + Install GKE Plugin + run: | + gcloud auth activate-service-account github-actions-187@web3-335312.iam.gserviceaccount.com --key-file=$GOOGLE_APPLICATION_CREDENTIALS + gcloud components install gke-gcloud-auth-plugin + + - name: Login to GCR + uses: docker/login-action@v3 + with: + registry: eu.gcr.io + username: _json_key + password: ${{ secrets.GCP_AUTH_KEY }} + + - name: Login to Kubernetes + uses: azure/k8s-set-context@v1 + with: + kubeconfig: ${{ secrets.KUBECONFIG }} + cluster-context: "gke_web3-335312_europe-west1-b_web3-staging" + namespace: "character-builder-production" + + - name: Build and push Docker images + run: | + cd frontend + export $(grep -v '^#' .env.mainnet | xargs) + envsubst < ../deployment/mainnet/workloads/config/ui-config.template.yaml > ../deployment/mainnet/workloads/config/ui-config.yaml + envsubst < skaffold.mainnet.template.yaml > skaffold.mainnet.yaml + skaffold run --filename skaffold.mainnet.yaml + shell: bash + \ No newline at end of file diff --git a/azure-pipelines-emerynet.yml b/azure-pipelines-emerynet.yml deleted file mode 100644 index d158caafd..000000000 --- a/azure-pipelines-emerynet.yml +++ /dev/null @@ -1,59 +0,0 @@ -name: CI/CD Emerynet - -on: - workflow_dispatch: # Allows manual triggering - -jobs: - build_and_deploy: - runs-on: ubuntu-latest - - steps: - - name: Checkout Repository - uses: actions/checkout@v2 - - - name: Install Skaffold - run: | - curl -Lo skaffold https://storage.googleapis.com/skaffold/releases/latest/skaffold-linux-amd64 - sudo install skaffold /usr/local/bin/ - shell: bash - - - name: Download Service Account Key - uses: actions/checkout@v2 - with: - path: ${{ runner.workspace }}/authkey - env: - GCP_AUTH_KEY: ${{ secrets.GCP_AUTH_KEY }} - shell: bash - - - name: Set Google Cloud Credentials - run: | - echo "$GCP_AUTH_KEY" > $GITHUB_WORKSPACE/authkey/google-credentials.json - export GOOGLE_APPLICATION_CREDENTIALS="$GITHUB_WORKSPACE/authkey/google-credentials.json" - shell: bash - - - name: Configure Docker to Authenticate with Google Cloud - run: | - gcloud auth configure-docker - shell: bash - - - name: Login to Container Registry - run: docker login -u _json_key -p "$GCP_AUTH_KEY" https://gcr.io - env: - DOCKER_CLI_ACI_SERVER: ${{ secrets.CONTAINER_REGISTRY_SERVER }} - shell: bash - - - name: Login to Kubernetes - uses: azure/k8s-set-context@v1 - with: - kubeconfig: ${{ secrets.KUBECONFIG }} - cluster-context: "gke-service-connection" - namespace: "agoric-makefile-automation" - - - name: Build and push Docker images - run: | - cd frontend - export $(grep -v '^#' .env.emerynet | xargs) - envsubst < ../deployment/emerynet/workloads/config/ui-config.template.yaml > ../deployment/emerynet/workloads/config/ui-config.yaml - envsubst < skaffold.emerynet.template.yaml > skaffold.emerynet.yaml - skaffold run --filename skaffold.emerynet.yaml - shell: bash diff --git a/azure-pipelines-prod.yml b/azure-pipelines-prod.yml deleted file mode 100644 index 48c1a6720..000000000 --- a/azure-pipelines-prod.yml +++ /dev/null @@ -1,38 +0,0 @@ -trigger: - - production - -pool: - vmImage: "ubuntu-latest" - -stages: - - stage: build_and_deploy - displayName: Build and Deploy - dependsOn: [] - condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest')) - jobs: - - job: build_and_deploy - displayName: Build Docker images and deploy through Kubernetes - steps: - - script: curl -Lo skaffold https://storage.googleapis.com/skaffold/releases/latest/skaffold-linux-amd64 && sudo install skaffold /usr/local/bin/ - displayName: Install Skaffold - - task: DownloadSecureFile@1 - name: authkey - displayName: "Download Service Account Key" - inputs: - secureFile: web3-agoric.json - retryCount: "2" - - script: gcloud auth activate-service-account web3-agoric-0@web3-335312.iam.gserviceaccount.com --key-file=$(authkey.secureFilePath) - displayName: Activate Service Account - - task: Kubernetes@1 - inputs: - connectionType: "Kubernetes Service Connection" - kubernetesServiceEndpoint: "gke-service-connection" - namespace: "character-builder-prod" - command: "login" - - script: | - cd frontend - export $(grep -v '^#' .env.production | xargs) - envsubst < ../deployment/production/workloads/config/ui-config.template.yaml > ../deployment/production/workloads/config/ui-config.yaml - envsubst < skaffold.production.template.yaml > skaffold.production.yaml - skaffold run --filename skaffold.production.yaml - displayName: Build and push docker images diff --git a/azure-pipelines.old.yml b/azure-pipelines.old.yml deleted file mode 100644 index 0f0aa66fc..000000000 --- a/azure-pipelines.old.yml +++ /dev/null @@ -1,58 +0,0 @@ -trigger: - - develop - -pool: - vmImage: "ubuntu-latest" - -stages: - - stage: build - displayName: Build - dependsOn: [] - condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest')) - jobs: - - job: build - displayName: Build Docker images - steps: - - script: curl -Lo skaffold https://storage.googleapis.com/skaffold/releases/latest/skaffold-linux-amd64 && sudo install skaffold /usr/local/bin/ - displayName: Install Skaffold - - script: echo "##vso[task.setvariable variable=BUILDSTATE;isOutput=true]build-$(git rev-list -1 HEAD --abbrev-commit).json" - name: printvar - displayName: Write state variable - - task: DownloadSecureFile@1 - name: authkey - displayName: "Download Service Account Key" - inputs: - secureFile: web3-agoric.json - retryCount: "2" - - script: gcloud auth activate-service-account web3-agoric-0@web3-335312.iam.gserviceaccount.com --key-file=$(authkey.secureFilePath) - displayName: Activate Service Account - - script: cd frontend && skaffold build --filename skaffold.staging.yaml --file-output "../$(printvar.BUILDSTATE)" - displayName: Build and push docker images - - publish: $(printvar.BUILDSTATE) - artifact: BuildArtifacts - displayName: Publish build artifacts - - - stage: deploy - displayName: Deploy - dependsOn: [build] - variables: - BUILDSTATE: $[ stageDependencies.build.build.outputs['printvar.BUILDSTATE'] ] - jobs: - - job: deploy - displayName: Deploy - steps: - - task: Kubernetes@1 - inputs: - connectionType: "Kubernetes Service Connection" - kubernetesServiceEndpoint: "gke-service-connection" - namespace: "character-builder-staging" - command: "login" - - script: curl -Lo skaffold https://storage.googleapis.com/skaffold/releases/latest/skaffold-linux-amd64 && sudo install skaffold /usr/local/bin/ - displayName: Install Skaffold - - task: DownloadPipelineArtifact@2 - displayName: Download build artifacts - inputs: - artifactName: BuildArtifacts - targetPath: $(System.DefaultWorkingDirectory) - - script: cd frontend && skaffold deploy --filename skaffold.staging.yaml --build-artifacts "../$(BUILDSTATE)" - displayName: Deploy build artifacts diff --git a/azure-pipelines.yml b/azure-pipelines.yml deleted file mode 100644 index 4c7cbbeec..000000000 --- a/azure-pipelines.yml +++ /dev/null @@ -1,38 +0,0 @@ -trigger: - - develop - -pool: - vmImage: "ubuntu-latest" - -stages: - - stage: build_and_deploy - displayName: Build and Deploy - dependsOn: [] - condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest')) - jobs: - - job: build_and_deploy - displayName: Build Docker images and deploy through Kubernetes - steps: - - script: curl -Lo skaffold https://storage.googleapis.com/skaffold/releases/latest/skaffold-linux-amd64 && sudo install skaffold /usr/local/bin/ - displayName: Install Skaffold - - task: DownloadSecureFile@1 - name: authkey - displayName: "Download Service Account Key" - inputs: - secureFile: web3-agoric.json - retryCount: "2" - - script: gcloud auth activate-service-account web3-agoric-0@web3-335312.iam.gserviceaccount.com --key-file=$(authkey.secureFilePath) - displayName: Activate Service Account - - task: Kubernetes@1 - inputs: - connectionType: "Kubernetes Service Connection" - kubernetesServiceEndpoint: "gke-service-connection" - namespace: "character-builder-staging" - command: "login" - - script: | - cd frontend - export $(grep -v '^#' .env.staging | xargs) - envsubst < ../deployment/staging/workloads/config/ui-config.template.yaml > ../deployment/staging/workloads/config/ui-config.yaml - envsubst < skaffold.staging.template.yaml > skaffold.staging.yaml - skaffold run --filename skaffold.staging.yaml - displayName: Build and push docker images From 2b616393e021fbe21f53dc241252f25429ca0a18 Mon Sep 17 00:00:00 2001 From: Xabier Almazor Date: Wed, 11 Oct 2023 15:33:20 +0200 Subject: [PATCH 62/71] Add codeowners --- CODEOWNERS | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 CODEOWNERS diff --git a/CODEOWNERS b/CODEOWNERS new file mode 100644 index 000000000..83abb500f --- /dev/null +++ b/CODEOWNERS @@ -0,0 +1,2 @@ +* @WietzeSlagman +* @carlos-kryha From 4aee6bd263976b3f2bbfd293d26579f33825d3bc Mon Sep 17 00:00:00 2001 From: Xabier <146219902+snthtcs@users.noreply.github.com> Date: Wed, 11 Oct 2023 19:30:05 +0200 Subject: [PATCH 63/71] Update kread-emerynet-cicd.yml task name --- .github/workflows/kread-emerynet-cicd.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/kread-emerynet-cicd.yml b/.github/workflows/kread-emerynet-cicd.yml index 533eb40a6..ef96c5549 100644 --- a/.github/workflows/kread-emerynet-cicd.yml +++ b/.github/workflows/kread-emerynet-cicd.yml @@ -28,7 +28,7 @@ jobs: project_id: web3-335312 export_default_credentials: true - - name: Activate Service Account + Install GKE Plugin + - name: Activate Service Account run: | gcloud auth activate-service-account github-actions-187@web3-335312.iam.gserviceaccount.com --key-file=$GOOGLE_APPLICATION_CREDENTIALS gcloud components install gke-gcloud-auth-plugin @@ -55,4 +55,4 @@ jobs: envsubst < skaffold.emerynet.template.yaml > skaffold.emerynet.yaml skaffold run --filename skaffold.emerynet.yaml shell: bash - \ No newline at end of file + From 1222415e908cd63c809a474e8043e96da0485c08 Mon Sep 17 00:00:00 2001 From: Xabier <146219902+snthtcs@users.noreply.github.com> Date: Wed, 11 Oct 2023 19:34:37 +0200 Subject: [PATCH 64/71] Update kread-mainnet-cicd.yml add new secrets --- .github/workflows/kread-mainnet-cicd.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/kread-mainnet-cicd.yml b/.github/workflows/kread-mainnet-cicd.yml index 6d437612f..63078152e 100644 --- a/.github/workflows/kread-mainnet-cicd.yml +++ b/.github/workflows/kread-mainnet-cicd.yml @@ -25,10 +25,10 @@ jobs: uses: google-github-actions/setup-gcloud@v0 with: service_account_key: ${{ secrets.GCP_AUTH_KEY }} - project_id: web3-335312 + project_id: ${{ secrets.PROJECT_ID }} export_default_credentials: true - - name: Activate Service Account + Install GKE Plugin + - name: Activate Service Account run: | gcloud auth activate-service-account github-actions-187@web3-335312.iam.gserviceaccount.com --key-file=$GOOGLE_APPLICATION_CREDENTIALS gcloud components install gke-gcloud-auth-plugin @@ -44,8 +44,8 @@ jobs: uses: azure/k8s-set-context@v1 with: kubeconfig: ${{ secrets.KUBECONFIG }} - cluster-context: "gke_web3-335312_europe-west1-b_web3-staging" - namespace: "character-builder-production" + cluster-context: ${{ secrets.CLUSTER_CONTEXT }} + namespace: ${{ secrets.K8S_NAMESPACE_MAINNET }} - name: Build and push Docker images run: | @@ -55,4 +55,4 @@ jobs: envsubst < skaffold.mainnet.template.yaml > skaffold.mainnet.yaml skaffold run --filename skaffold.mainnet.yaml shell: bash - \ No newline at end of file + From 480cc8dde6ca4959362939b8a088a5de61a7b242 Mon Sep 17 00:00:00 2001 From: Xabier <146219902+snthtcs@users.noreply.github.com> Date: Wed, 11 Oct 2023 19:36:26 +0200 Subject: [PATCH 65/71] Update kread-emerynet-cicd.yml add new secrets --- .github/workflows/kread-emerynet-cicd.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/kread-emerynet-cicd.yml b/.github/workflows/kread-emerynet-cicd.yml index ef96c5549..25c7982a3 100644 --- a/.github/workflows/kread-emerynet-cicd.yml +++ b/.github/workflows/kread-emerynet-cicd.yml @@ -25,7 +25,7 @@ jobs: uses: google-github-actions/setup-gcloud@v0 with: service_account_key: ${{ secrets.GCP_AUTH_KEY }} - project_id: web3-335312 + project_id: ${{ secrets.PROJECT_ID }} export_default_credentials: true - name: Activate Service Account @@ -44,8 +44,8 @@ jobs: uses: azure/k8s-set-context@v1 with: kubeconfig: ${{ secrets.KUBECONFIG }} - cluster-context: "gke_web3-335312_europe-west1-b_web3-staging" - namespace: "agoric-makefile-automation" + cluster-context: ${{ secrets.CLUSTER_CONTEXT }} + namespace: ${{ secrets.K8S_NAMESPACE_EMERYNET }} - name: Build and push Docker images run: | From efab6ecd9224760ccac968bca60b6ce2483e025b Mon Sep 17 00:00:00 2001 From: Xabier <146219902+snthtcs@users.noreply.github.com> Date: Wed, 11 Oct 2023 19:46:15 +0200 Subject: [PATCH 66/71] Update kread-emerynet-cicd.yml service account param --- .github/workflows/kread-emerynet-cicd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/kread-emerynet-cicd.yml b/.github/workflows/kread-emerynet-cicd.yml index 25c7982a3..c2bc632b9 100644 --- a/.github/workflows/kread-emerynet-cicd.yml +++ b/.github/workflows/kread-emerynet-cicd.yml @@ -30,7 +30,7 @@ jobs: - name: Activate Service Account run: | - gcloud auth activate-service-account github-actions-187@web3-335312.iam.gserviceaccount.com --key-file=$GOOGLE_APPLICATION_CREDENTIALS + gcloud auth activate-service-account ${{ secrets.GCP_SA }} --key-file=$GOOGLE_APPLICATION_CREDENTIALS gcloud components install gke-gcloud-auth-plugin - name: Login to GCR From 0e46ad734f98a294eed5b538c9c30e094e4b113d Mon Sep 17 00:00:00 2001 From: Xabier <146219902+snthtcs@users.noreply.github.com> Date: Wed, 11 Oct 2023 19:46:57 +0200 Subject: [PATCH 67/71] Update kread-mainnet-cicd.yml add sa param --- .github/workflows/kread-mainnet-cicd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/kread-mainnet-cicd.yml b/.github/workflows/kread-mainnet-cicd.yml index 63078152e..a81799457 100644 --- a/.github/workflows/kread-mainnet-cicd.yml +++ b/.github/workflows/kread-mainnet-cicd.yml @@ -30,7 +30,7 @@ jobs: - name: Activate Service Account run: | - gcloud auth activate-service-account github-actions-187@web3-335312.iam.gserviceaccount.com --key-file=$GOOGLE_APPLICATION_CREDENTIALS + gcloud auth activate-service-account ${{ secrets.GCP_SA }} --key-file=$GOOGLE_APPLICATION_CREDENTIALS gcloud components install gke-gcloud-auth-plugin - name: Login to GCR From bc4b7517b2f16cb8f807799b270499a770f8afea Mon Sep 17 00:00:00 2001 From: Xabier <146219902+snthtcs@users.noreply.github.com> Date: Wed, 11 Oct 2023 19:49:05 +0200 Subject: [PATCH 68/71] test changes --- .github/workflows/kread-emerynet-cicd.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/kread-emerynet-cicd.yml b/.github/workflows/kread-emerynet-cicd.yml index c2bc632b9..a11354117 100644 --- a/.github/workflows/kread-emerynet-cicd.yml +++ b/.github/workflows/kread-emerynet-cicd.yml @@ -1,11 +1,7 @@ name: CI/CD Emerynet on: - pull_request: - branches: - - develop - types: - - closed + push jobs: build_and_deploy: From 944f9a495185d33387c2a7330e2a4049d1f64f94 Mon Sep 17 00:00:00 2001 From: Xabier <146219902+snthtcs@users.noreply.github.com> Date: Wed, 11 Oct 2023 19:52:54 +0200 Subject: [PATCH 69/71] Update kread-emerynet-cicd.yml --- .github/workflows/kread-emerynet-cicd.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/kread-emerynet-cicd.yml b/.github/workflows/kread-emerynet-cicd.yml index a11354117..787321f9e 100644 --- a/.github/workflows/kread-emerynet-cicd.yml +++ b/.github/workflows/kread-emerynet-cicd.yml @@ -1,7 +1,11 @@ name: CI/CD Emerynet on: - push + pull_request: + branches: + - develop + types: + - closed jobs: build_and_deploy: @@ -11,7 +15,7 @@ jobs: - name: Checkout Repository uses: actions/checkout@v2 - - name: Install Skaffold + GKE Auth Plugin + - name: Install Skaffold run: | curl -Lo skaffold https://storage.googleapis.com/skaffold/releases/latest/skaffold-linux-amd64 sudo install skaffold /usr/local/bin/ From b3a157e6d66d3fac4065805a5ff90c31e15a6b56 Mon Sep 17 00:00:00 2001 From: Xabier <146219902+snthtcs@users.noreply.github.com> Date: Wed, 11 Oct 2023 19:53:06 +0200 Subject: [PATCH 70/71] Update kread-mainnet-cicd.yml --- .github/workflows/kread-mainnet-cicd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/kread-mainnet-cicd.yml b/.github/workflows/kread-mainnet-cicd.yml index a81799457..267b959d6 100644 --- a/.github/workflows/kread-mainnet-cicd.yml +++ b/.github/workflows/kread-mainnet-cicd.yml @@ -15,7 +15,7 @@ jobs: - name: Checkout Repository uses: actions/checkout@v2 - - name: Install Skaffold + GKE Auth Plugin + - name: Install Skaffold run: | curl -Lo skaffold https://storage.googleapis.com/skaffold/releases/latest/skaffold-linux-amd64 sudo install skaffold /usr/local/bin/ From 64126c6439a9d2a471b9ac5024947bfcf5a42fe3 Mon Sep 17 00:00:00 2001 From: Xabier <146219902+snthtcs@users.noreply.github.com> Date: Thu, 12 Oct 2023 09:54:06 +0200 Subject: [PATCH 71/71] Update items-shop.tsx with develop content --- frontend/src/pages/shop/items-shop.tsx | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/frontend/src/pages/shop/items-shop.tsx b/frontend/src/pages/shop/items-shop.tsx index 69d8e5449..95db7394c 100644 --- a/frontend/src/pages/shop/items-shop.tsx +++ b/frontend/src/pages/shop/items-shop.tsx @@ -42,10 +42,6 @@ export const ItemsShop: FC = () => { } if (!items) return <>; - - //FIXME: disable hair and perk for now until fixed - const filteredItems = items.filter((entry) => entry.item.category != "hair" && entry.item.category != "perk2"); - return ( <> @@ -55,8 +51,8 @@ export const ItemsShop: FC = () => { Market: {text.param.amountOfItems(assetsCount)} {selectedId && item && setSelectedId(id)} />} - {filteredItems.length > 0 ? ( - setSelectedId(id)} /> + {items.length > 0 ? ( + setSelectedId(id)} /> ) : (