Skip to content

Commit

Permalink
fix: start in mac env
Browse files Browse the repository at this point in the history
  • Loading branch information
aronchanisme committed Oct 9, 2023
1 parent 6a4d85a commit 20ab24b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .github/workflows/unit_test_mac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1098,6 +1098,9 @@ jobs:
- name: Test_5. 'mo_ctl start'
run: |
echo ""
RUN_TAG="$(date "+%Y%m%d_%H%M%S")"
mkdir -p ${{ env.MO_PATH }}/${RUN_TAG}
mo_ctl set_conf MO_CONTAINER_DATA_HOST_PATH="${{ env.MO_PATH }}/${RUN_TAG}"
mo_ctl start && mo_ctl status
- name: Test_6. 'mo_ctl status' (mo-service running)
run: |
Expand Down
10 changes: 9 additions & 1 deletion bin/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,15 @@ function start()
return 0
fi

total_mem=`free -m | awk 'NR==2{print $2}'`
os=`what_os`

if [[ "${os}" == "Mac" ]]; then
total_mem_bytes=`sysctl hw.memsize | awk -F ":" '{print $2}' | sed 's/ //g'`
total_mem=`expr $total_mem_bytes / 1024 / 1024`
else
total_mem=`free -m | awk 'NR==2{print $2}'`
fi

add_log "D" "Check total memory on current machine, command: free -m | awk 'NR==2{print $2}', result(Mi): ${total_mem}"
docker_mem_limit=""
go_mem_limit=""
Expand Down

0 comments on commit 20ab24b

Please sign in to comment.