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

ci: add more test env #28

Merged
merged 11 commits into from
Jan 15, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
57 changes: 56 additions & 1 deletion .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
- main

jobs:
build:
build-and-lint-test:
runs-on: ubuntu-22.04

steps:
Expand All @@ -25,3 +25,58 @@ jobs:

- name: Dry run `nebulagraph start`
run: nebulagraph --debug start --cleanup

e2e-bare-metal:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-latest]
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Run Build and Install
run: |
echo "Running tests on ${{ matrix.os }}"
pip3 install .
- name: Dry run `nebulagraph start`
run: nebulagraph --debug start --cleanup

e2e-docker:
runs-on: ubuntu-22.04
strategy:
matrix:
image: ["ubuntu:20.04", "rockylinux:9", "ubuntu:latest"]
container:
image: ${{ matrix.image }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Dependencies
run: |
if grep -qEi "debian|buntu" /etc/*release; then
apt-get update && apt-get install python3-pip curl -y
else
yum update -y && yum install python3-pip which -y
fi
- name: Install NebulaGraph-Lite
run: pip3 install .
- name: Run NebulaGraph-Lite in container
run: nebulagraph --debug --container start

# e2e-alpine:
# runs-on: ubuntu-22.04
# strategy:
# matrix:
# image: ["alpine:3.14", "alpine:latest"]
# container:
# image: ${{ matrix.image }}
# steps:
# - name: Checkout code
# uses: actions/checkout@v3
# - name: Install Dependencies
# run: |
# apk add --no-cache python3 py3-pip curl pipx py3-psutil
# - name: Install NebulaGraph-Lite
# run: pip3 install --break-system-packages .
# - name: Run NebulaGraph-Lite in container
# run: nebulagraph --debug --container start
12 changes: 6 additions & 6 deletions design/how_it_works_via_shell.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ cd ~/.nebulagraph/lite
# --v=0 \
# --minloglevel=0

udocker --debug create \
udocker --allow-root --debug create \
--name=nebula-metad \
vesoft/nebula-metad:v3

udocker --allow-root setup --execmode=F1 nebula-metad

udocker --debug run \
udocker --debug --allow-root run \
--user=root \
-v /home/w/.nebulagraph/lite/data/meta0:/data/meta \
-v /home/w/.nebulagraph/lite/logs/meta0:/logs \
Expand All @@ -53,7 +53,7 @@ udocker --debug run \
--minloglevel=0

# Run NebulaGraph GraphD
udocker --debug run --rm \
udocker --debug --allow-root run --rm \
--user=root \
-v /home/w/.nebulagraph/lite/logs/graph:/logs \
vesoft/nebula-graphd:v3 \
Expand Down Expand Up @@ -83,13 +83,13 @@ udocker --debug run --rm \
# --v=0 \
# --minloglevel=0

udocker --debug create \
udocker --debug --allow-root create \
--name=nebula-storaged \
vesoft/nebula-storaged:v3

udocker --allow-root setup --execmode=F1 nebula-storaged

udocker --debug run \
udocker --debug --allow-root run \
--user=root \
-v /home/w/.nebulagraph/lite/data/storage0:/data/storage \
-v /home/w/.nebulagraph/lite/logs/storage0:/logs \
Expand All @@ -107,6 +107,6 @@ udocker --debug run \
# Run NebulaGraph Console

# i.e. add hosts
udocker --debug run --rm \
udocker --debug --allow-root run --rm \
vesoft/nebula-console:v3 \
-addr 127.0.0.1 -port 39669 -u root -p nebula -e 'ADD HOSTS "127.0.0.1":9779'
2 changes: 1 addition & 1 deletion pdm.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ authors = [
]
dependencies = [
"udocker>=1.3.12",
"psutil>=5.9.7",
"psutil>=5.9.6",
]
requires-python = ">=3.8"
readme = "README.md"
Expand Down
2 changes: 1 addition & 1 deletion src/nebulagraph_lite/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

__all__ = ["nebulagraph_let"]

__version__ = "0.1.0"
__version__ = "0.1.1"
8 changes: 4 additions & 4 deletions src/nebulagraph_lite/nebulagraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def __init__(
else:
self._python_bin_path = os.path.dirname(os.sys.executable)
result = subprocess.run(
f"{self._python_bin_path}/udocker --help",
f"{self._python_bin_path}/udocker --allow-root --help",
shell=True,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
Expand Down Expand Up @@ -230,7 +230,7 @@ def udocker_pull_backgroud(self, image: str):
def _try_shoot_service(self, service: str):
try:
self._run_udocker(
f"ps | grep {service} | awk '{{print $1}}' | xargs -I {{}} udocker rm -f {{}}"
f"ps | grep {service} | awk '{{print $1}}' | xargs -I {{}} udocker --allow-root rm -f {{}}"
)
# TODO: use psutil to kill the process
os.system(f"killall nebula-{service} > /dev/null 2>&1")
Expand Down Expand Up @@ -283,7 +283,7 @@ def start_metad(self, shoot=False):
def start_graphd(self):
self._try_shoot_service("graphd")

udocker_create_command = "ps | grep graphd || udocker --debug create --name=nebula-graphd vesoft/nebula-graphd:v3"
udocker_create_command = "ps | grep graphd || udocker --debug --allow-root create --name=nebula-graphd vesoft/nebula-graphd:v3"
if self._debug:
fancy_print(
"Info: [DEBUG] creating graphd container... with command:"
Expand Down Expand Up @@ -459,7 +459,7 @@ def shutdown(self):
"""
if self.on_colab:
self._run_udocker(
"ps | grep nebula | awk '{print $1}' | xargs -I {} udocker rm -f {}"
"ps | grep nebula | awk '{print $1}' | xargs -I {} udocker --allow-root rm -f {}"
)
self._try_shoot_all_services()
return
Expand Down