Skip to content

Commit

Permalink
Merge pull request #63 from cognitedata/anders/release-24-09-03-2
Browse files Browse the repository at this point in the history
Release production
  • Loading branch information
andeplane authored Sep 3, 2024
2 parents 9a83029 + 62d3a40 commit 6cef679
Show file tree
Hide file tree
Showing 225 changed files with 7,004 additions and 2,187 deletions.
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ updates:
schedule:
interval: "daily"
- package-ecosystem: "pip"
directory: "/packages/kernel/py/stlite-server"
directory: "/packages/kernel/py/stlite-lib"
schedule:
interval: "daily"
205 changes: 102 additions & 103 deletions .github/workflows/deploy-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
env:
GITHUB_PAGES_SUBDIR_MOUNTABLE: lib/mountable
USE_CONSTRAINTS_FILE: false # https://github.com/streamlit/streamlit/blob/1.27.0/.github/workflows/release.yml#L67-L68

jobs:
build:
strategy:
Expand All @@ -26,89 +26,89 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
submodules: true

## Set up Python and Poetry environment
- name: Set up Python ${{ env.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ env.python-version }}

# The following steps are based on https://github.com/python-poetry/poetry/blob/def1ee8f3ae00c307ca028da53d2347615c5c32b/.github/workflows/main.yml#L51-L84
- name: Get full Python version
id: full-python-version
run: echo version=$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))") >> $GITHUB_OUTPUT

- name: Bootstrap poetry
run: |
curl -sL https://install.python-poetry.org | python - -y
- name: Update PATH
run: echo "$HOME/.local/bin" >> $GITHUB_PATH

- name: Configure poetry
run: poetry config virtualenvs.in-project false

- name: Set up cache
uses: actions/cache@v3
id: cache
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }}

- name: Ensure cache is healthy
if: steps.cache.outputs.cache-hit == 'true'
run: timeout 10s pip --version || rm -rf .venv

- name: Create virtualenv
run: python -m venv .venv

## Set up Node environment
- uses: actions/setup-node@v3
with:
node-version-file: .nvmrc
cache: 'yarn'
- run: yarn install --frozen-lockfile

# We require protoc >= 3.20, but Ubuntu 22.04 - the OS that these Github
# Actions are running as of 2023.05.03 - doesn't have recent versions
# of protoc in its package repository.
# Ref: https://github.com/streamlit/streamlit/blob/1.23.1/.github/actions/make_init/action.yml#L47-L56
# So we download the precompiled binary from the release page and install it,
# following https://grpc.io/docs/protoc-installation/#install-pre-compiled-binaries-any-os
- name: Install protoc
run: |
curl -LO $PB_REL/download/v3.20.3/protoc-3.20.3-linux-x86_64.zip
unzip protoc-3.20.3-linux-x86_64.zip -d $HOME/.local
echo "$HOME/.local/bin" >> $GITHUB_PATH
env:
PB_REL: "https://github.com/protocolbuffers/protobuf/releases"
- name: Set up
run: make init
## Build and deploy @stlite/mountable
# PUBLIC_URL here is set as a relative path, which is possible to the trick introduced at https://github.com/whitphx/stlite/pull/143.
- if: matrix.target == 'mountable'
name: Set PUBLIC_URL
run: echo "PUBLIC_URL=." >> $GITHUB_ENV
- if: matrix.target == 'mountable'
name: Build @stlite/mountable
run: |
. .venv/bin/activate
make mountable
- if: matrix.target == 'mountable'
name: Copy firebase.json
run: cp firebase.json packages/mountable/build/
- if: matrix.target == 'mountable'
name: Upload the built files as an artifact
uses: actions/upload-artifact@v3
with:
name: stlite-mountable
path: packages/mountable/build
- uses: actions/checkout@v3
with:
submodules: true

## Set up Python and Poetry environment
- name: Set up Python ${{ env.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ env.python-version }}

# The following steps are based on https://github.com/python-poetry/poetry/blob/def1ee8f3ae00c307ca028da53d2347615c5c32b/.github/workflows/main.yml#L51-L84
- name: Get full Python version
id: full-python-version
run: echo version=$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))") >> $GITHUB_OUTPUT

- name: Bootstrap poetry
run: |
curl -sL https://install.python-poetry.org | python - -y
- name: Update PATH
run: echo "$HOME/.local/bin" >> $GITHUB_PATH

- name: Configure poetry
run: poetry config virtualenvs.in-project false

- name: Set up cache
uses: actions/cache@v3
id: cache
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }}

- name: Ensure cache is healthy
if: steps.cache.outputs.cache-hit == 'true'
run: timeout 10s pip --version || rm -rf .venv

- name: Create virtualenv
run: python -m venv .venv

## Set up Node environment
- uses: actions/setup-node@v3
with:
node-version-file: .nvmrc
cache: "yarn"
- run: yarn install --frozen-lockfile

# We require protoc >= 3.20, but Ubuntu 22.04 - the OS that these Github
# Actions are running as of 2023.05.03 - doesn't have recent versions
# of protoc in its package repository.
# Ref: https://github.com/streamlit/streamlit/blob/1.23.1/.github/actions/make_init/action.yml#L47-L56
# So we download the precompiled binary from the release page and install it,
# following https://grpc.io/docs/protoc-installation/#install-pre-compiled-binaries-any-os
- name: Install protoc
run: |
curl -LO $PB_REL/download/v3.20.3/protoc-3.20.3-linux-x86_64.zip
unzip protoc-3.20.3-linux-x86_64.zip -d $HOME/.local
echo "$HOME/.local/bin" >> $GITHUB_PATH
env:
PB_REL: "https://github.com/protocolbuffers/protobuf/releases"
- name: Set up
run: make init

## Build and deploy @stlite/mountable
# PUBLIC_URL here is set as a relative path, which is possible to the trick introduced at https://github.com/whitphx/stlite/pull/143.
- if: matrix.target == 'mountable'
name: Set PUBLIC_URL
run: echo "PUBLIC_URL=." >> $GITHUB_ENV

- if: matrix.target == 'mountable'
name: Build @stlite/mountable
run: |
. .venv/bin/activate
make mountable
- if: matrix.target == 'mountable'
name: Copy firebase.json
run: cp firebase.json packages/mountable/build/
- if: matrix.target == 'mountable'
name: Upload the built files as an artifact
uses: actions/upload-artifact@v3
with:
name: stlite-mountable
path: packages/mountable/build

deploy:
environment: CD
Expand All @@ -123,22 +123,21 @@ jobs:
group: ${{ github.workflow }}-${{ github.ref }}

steps:
- uses: actions/download-artifact@v3
with:
name: stlite-mountable
path: mountable
- name: Copy firebase.json to the root directory
run: |
cp -r ./mountable/firebase.json $(pwd)
- name: Rename the manifest file
run: |
mv ./mountable/asset-manifest.json ./mountable/manifest.json
# Deploying to Firebase
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_HOSTING_DEPLOY_SA }}'
channelId: live
projectId: fusion-217032465111
target: cognite-stlite-standalone-staging

- uses: actions/download-artifact@v3
with:
name: stlite-mountable
path: mountable
- name: Copy firebase.json to the root directory
run: |
cp -r ./mountable/firebase.json $(pwd)
- name: Rename the manifest file
run: |
mv ./mountable/asset-manifest.json ./mountable/manifest.json
# Deploying to Firebase
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: "${{ secrets.GITHUB_TOKEN }}"
firebaseServiceAccount: "${{ secrets.FIREBASE_HOSTING_DEPLOY_SA }}"
channelId: live
projectId: fusion-217032465111
target: cognite-stlite-standalone-staging
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"makefile.extensionOutputFolder": "./.vscode"
"python.analysis.extraPaths": ["./streamlit/lib"]
}
Loading

0 comments on commit 6cef679

Please sign in to comment.