Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(e2e): fix console building issue #1707

Merged
merged 4 commits into from
Jan 11, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/console.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ jobs:
echo "::set-output name=dir::"
yarn cache dir

- name: Install yarn
- name: Install dev tools
working-directory: ./console
run: make install-yarn
run: make install-dev-tools

- uses: actions/cache@v3
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
Expand Down
15 changes: 11 additions & 4 deletions console/Makefile
Original file line number Diff line number Diff line change
@@ -1,19 +1,26 @@
install-yarn:
npm install -g yarn
.PHONY: *

install-dev-tools:
npm install -g yarn pnpm

install-dependencies:
yarn

build-ui:
yarn build

ci-lint:
yarn lint
yarn typecheck

rebuild-gradio:
rm -rf gradio && git clone --depth 1 --branch=feat/sw-gradio-widget https://github.com/star-whale/gradio gradio
pushd gradio/ui && \
cd gradio/ui && \
pnpm i && \
pnpm build && \
cd ../.. && \
rm -rf src/assets/GradioWidget && mkdir -p src/assets/GradioWidget && \
mv packages/starwhale/build src/assets/GradioWidget/es && popd
mv gradio/ui/packages/starwhale/build src/assets/GradioWidget/es
rm -rf gradio

build-all: install-dependencies rebuild-gradio build-ui
12 changes: 5 additions & 7 deletions scripts/client_test/cli_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,16 +273,14 @@ def test_all(self) -> None:
self.build_runtime(rt["workdir"])

for name, expl in EXAMPLES.items():
p = subprocess.Popen(
print(f"preparing data for {expl}")
goldenxinxing marked this conversation as resolved.
Show resolved Hide resolved
rc = subprocess.call(
["make", "CN=1", "prepare-data"],
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
cwd=expl["workdir"],
)
goldenxinxing marked this conversation as resolved.
Show resolved Hide resolved
with p.stdout: # type: ignore
for line in iter(p.stdout.readline, b""): # type: ignore
logging.info("got line from subprocess: %r", line)
assert not p.wait()
if rc != 0:
print(f"prepare data for {expl} failed")
raise

for name, expl in EXAMPLES.items():
workdir_ = expl["workdir"]
Expand Down
9 changes: 9 additions & 0 deletions scripts/e2e_test/start_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,16 @@ publish_to_k8s() {
popd
}

install_necessary_tools() {
if ! command -v unzip &> /dev/null
then
echo "installing unzip"
apt update && apt install -y unzip
fi
}

main() {
install_necessary_tools
declare_env
if ! in_github_action; then
trap exit_hook EXIT
Expand Down
2 changes: 1 addition & 1 deletion scripts/publish/pub.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ build() {
popd
else
pushd ../../console
yarn && yarn build
make install-dev-tools && make build-all
popd
fi
b_controller
Expand Down