Skip to content

Commit 3e6acf9

Browse files
committed
feat: v0.1.4 Fixed bug pygwalker, CI, Dockerfile
1 parent 01af7b3 commit 3e6acf9

8 files changed

Lines changed: 153 additions & 8 deletions

File tree

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Multi-Platform Docker Build
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
build-and-publish:
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
# Step 1: Check out the repository and submodules
12+
- name: Check out code
13+
uses: actions/checkout@v3
14+
with:
15+
submodules: true # Fetch submodules
16+
fetch-depth: 0 # Ensure the full history is fetched
17+
18+
# Step 2: Set up Docker Buildx
19+
- name: Set up Docker Buildx
20+
uses: docker/setup-buildx-action@v2
21+
22+
# Step 3: Install yq
23+
- name: Install yq
24+
run: |
25+
sudo apt-get update && sudo apt-get install -y wget
26+
sudo wget https://github.com/mikefarah/yq/releases/download/v4.35.1/yq_linux_amd64 -O /usr/bin/yq
27+
sudo chmod +x /usr/bin/yq
28+
29+
# Step 4: Extract component-version and component-name from odtp.yml
30+
- name: Extract component-version and component-name
31+
id: extract_info
32+
run: |
33+
VERSION=$(yq e '.component-version' odtp.yml)
34+
NAME=$(yq e '.component-name' odtp.yml)
35+
echo "VERSION=${VERSION}"
36+
echo "NAME=${NAME}"
37+
echo "COMPONENT_VERSION=${VERSION}" >> $GITHUB_ENV
38+
echo "COMPONENT_NAME=${NAME}" >> $GITHUB_ENV
39+
40+
# Step 5: Log in to GitHub Container Registry
41+
- name: Log in to GitHub Container Registry
42+
uses: docker/login-action@v2
43+
with:
44+
registry: ghcr.io
45+
username: ${{ github.actor }}
46+
password: ${{ secrets.GITHUB_TOKEN }}
47+
48+
# Step 6: Build and push Docker image for multiple platforms
49+
- name: Build and push Docker image
50+
run: |
51+
IMAGE_NAME=ghcr.io/${{ github.repository }}/${{ env.COMPONENT_NAME }}
52+
docker buildx build \
53+
--platform linux/amd64,linux/arm64 \
54+
--build-arg COMPONENT_VERSION=${{ env.COMPONENT_VERSION }} \
55+
-t $IMAGE_NAME:${{ env.COMPONENT_VERSION }} \
56+
-t $IMAGE_NAME:latest \
57+
--push .
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Multi-Platform Docker Build for Dockerhub
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
build-and-publish:
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
# Step 1: Check out the repository and submodules
12+
- name: Check out code
13+
uses: actions/checkout@v3
14+
with:
15+
submodules: true # Fetch submodules
16+
fetch-depth: 0 # Ensure the full history is fetched
17+
18+
# Step 2: Set up Docker Buildx
19+
- name: Set up Docker Buildx
20+
uses: docker/setup-buildx-action@v2
21+
22+
# Step 3: Install yq
23+
- name: Install yq
24+
run: |
25+
sudo apt-get update && sudo apt-get install -y wget
26+
sudo wget https://github.com/mikefarah/yq/releases/download/v4.35.1/yq_linux_amd64 -O /usr/bin/yq
27+
sudo chmod +x /usr/bin/yq
28+
29+
# Step 4: Extract component-version and component-name from odtp.yml
30+
- name: Extract component-version and component-name
31+
id: extract_info
32+
run: |
33+
VERSION=$(yq e '.component-version' odtp.yml)
34+
NAME=$(yq e '.component-name' odtp.yml)
35+
echo "VERSION=${VERSION}"
36+
echo "NAME=${NAME}"
37+
echo "COMPONENT_VERSION=${VERSION}" >> $GITHUB_ENV
38+
echo "COMPONENT_NAME=${NAME}" >> $GITHUB_ENV
39+
40+
# Step 5: Log in to Docker Hub
41+
- name: Log in to Docker Hub
42+
uses: docker/login-action@v2
43+
with:
44+
username: ${{ secrets.DOCKER_USERNAME }}
45+
password: ${{ secrets.DOCKER_PASSWORD }}
46+
47+
# Step 6: Build and push Docker image for multiple platforms
48+
- name: Build and push Docker image
49+
run: |
50+
IMAGE_NAME=${{ secrets.DOCKER_USERNAME }}/${{ env.COMPONENT_NAME }}
51+
docker buildx build \
52+
--platform linux/amd64,linux/arm64 \
53+
--build-arg COMPONENT_VERSION=${{ env.COMPONENT_VERSION }} \
54+
-t $IMAGE_NAME:${{ env.COMPONENT_VERSION }} \
55+
-t $IMAGE_NAME:latest \
56+
--push .

Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@ WORKDIR /odtp
7474
# Fix for end of the line issue on Windows
7575
##################################################
7676

77+
# Avoid error when building on windows
78+
RUN sed -i 's/\r$//' /odtp/odtp-component-client/src/shell/log.sh
79+
RUN sed -i 's/\r$//' /odtp/odtp-component-client/src/shell/traceback.sh
80+
RUN sed -i 's/\r$//' /odtp/odtp-component-client/scripts/component-update.sh
7781
RUN sed -i 's/\r$//' /odtp/odtp-component-client/odtp-app.sh
7882
RUN sed -i 's/\r$//' /odtp/odtp-component-client/startup.sh
7983
RUN sed -i 's/\r$//' /odtp/odtp-app/app.sh

README.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ CSV interactive visualization
1313
```
1414
odtp new odtp-component-entry \
1515
--name odtp-pygwalker \
16-
--component-version 0.1.0 \
16+
--component-version v0.1.4 \
1717
--repository https://github.com/caviri/odtp-pygwalker
1818
```
1919

@@ -47,11 +47,22 @@ Run the following command. Mount the correct volumes for input/output folders.
4747

4848
```
4949
docker run -it --rm \
50-
-v ./odtp-input:/odtp/odtp-input \
50+
-v $(pwd)/odtp-input:/odtp/odtp-input \
51+
-v $(pwd)/odtp-output:/odtp/odtp-output \
52+
-v $(pwd)/odtp-logs:/odtp/odtp-logs \
53+
-p 8081:8081 \
5154
--env-file .env odtp-pygwalker
5255
```
5356

5457

58+
## Changelog
59+
60+
- v0.1.4
61+
- Fix version pygwalker
62+
- ci github actions
63+
- Dockerfile compatible with Windows building
64+
65+
5566
## Developed by
5667

5768
SDSC

app/app.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,24 @@ def file_selector(folder_path='.'):
3333
# filename = st.sidebar.file_uploader("Upload a CSV file", type="csv")
3434
# st.sidebar.write('You selected `%s`' % filename)
3535

36+
37+
3638
if st.sidebar.button('Load CSV'):
3739
df = pd.read_csv(filename)
3840
pyg_app = StreamlitRenderer(df)
39-
pyg_app.explorer()
41+
pyg_app.explorer()
42+
43+
44+
45+
46+
# # You should cache your pygwalker renderer, if you don't want your memory to explode
47+
# @st.cache_resource
48+
# def get_pyg_renderer(file) -> "StreamlitRenderer":
49+
# df = pd.read_csv("./bike_sharing_dc.csv")
50+
# # If you want to use feature of saving chart config, set `spec_io_mode="rw"`
51+
# return StreamlitRenderer(df, spec="./gw_config.json", spec_io_mode="rw")
52+
53+
54+
# renderer = get_pyg_renderer()
55+
56+
# renderer.explorer()

odtp.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# This file should contain basic component information for your component.
22
component-name: odtp-pygwalker
33
component-author: Carlos Vivar Rios
4-
component-version: 0.1.0
4+
component-version: v0.1.4
55
component-repository: https://github.com/caviri/odtp-pygwalker
66
component-license: AGPL-3.0
77
component-type: interactive

requirements.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
streamlit
2-
pandas
3-
pygwalker
1+
streamlit==1.30.0
2+
pandas==2.2.3
3+
pygwalker==0.4.9.3

0 commit comments

Comments
 (0)