forked from v6d-io/v6d
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implements vineyard-operator to schedule jobs based on data locality. (…
…v6d-io#223) Vineyard operator is a kubernetes controller to operator the vineyard cluster. Within the vineyard operator, there's a scheduler-plugin called vineyard-scheduler which performs data aware job scheduling based on the locality information of objects in vineyard. Vineyard operator defines two CRDs to represents objects in vineyard: + GlobalObject for global objects + LocalObject for local objects The scheduler plugin works based the CRDs in the cluster. When vineyardd persists objects to etcd, it will create a CRD entry in kubernetes as well. The metadata of CRD has location information and scheduler plugin scores pod based on the data locality of required objects by jobs. For jobs, some label annotation are used to describe which objects are required in the pod spec. ``` labels: app: pytorch scheduling.k8s.v6d.io/job: pytorch scheduling.k8s.v6d.io/required: "o0000022285553e22" scheduling.k8s.v6d.io/replica: "4" ``` Resolves v6d-io#97. Signed-off-by: Tao He <linzhu.ht@alibaba-inc.com>
- Loading branch information
1 parent
bf019cf
commit b549f9a
Showing
124 changed files
with
6,390 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# Copyright 2020-2021 Alibaba Group Holding Limited. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
name: Kubernetes Operator | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
build: | ||
runs-on: ${{ matrix.os }} | ||
env: | ||
IMG: docker.pkg.github.com/v6d-io/v6d/vineyard-controller | ||
strategy: | ||
matrix: | ||
os: [ubuntu-20.04] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
submodules: true | ||
|
||
- uses: actions/setup-go@v2 | ||
with: | ||
go-version: '^1.15.0' # The Go version to download (if necessary) and use. | ||
|
||
- name: Login docker registry | ||
run: | | ||
echo ${{ secrets.GITHUB_TOKEN }} | sudo docker login https://docker.pkg.github.com -u $GITHUB_ACTOR --password-stdin | ||
- name: Operator | ||
run: | | ||
cd k8s | ||
make | ||
- name: Docker images | ||
run: | | ||
cd k8s | ||
sudo make docker-build IMG=${IMG}:${{ github.sha }} | ||
sudo docker tag ${IMG}:${{ github.sha }} ${IMG}:nightly | ||
- name: Publish docker images | ||
if: ${{ github.ref == 'refs/heads/main' && github.repository == 'v6d-io/v6d' }} | ||
run: | | ||
sudo make docker-push IMG=${IMG}:${{ github.sha }} | ||
sudo docker push ${IMG}:nightly |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
|
||
set -x | ||
set -e | ||
set -o pipefail | ||
|
||
ROOT=$(dirname "${BASH_SOURCE[0]}")/.. | ||
|
||
helm install vineyard $ROOT/vineyard/ -n vineyard-system \ | ||
--set image.repository="registry-vpc.cn-hongkong.aliyuncs.com/libvineyard/vineyardd" \ | ||
--set image.tagPrefix=ubuntu \ | ||
--set serviceAccountName=vineyard-server \ | ||
--set env[0].name="VINEYARD_SYNC_CRDS",env[0].value="1" \ | ||
--set vineyard.sharedMemorySize=8Gi | ||
|
||
set +x | ||
set +e | ||
set +o pipefail |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/bash | ||
|
||
set -x | ||
set -e | ||
set -o pipefail | ||
|
||
ROOT=$(dirname "${BASH_SOURCE[0]}")/.. | ||
|
||
helm install vineyard $ROOT/vineyard/ -n vineyard-system \ | ||
--set vineyard.sharedMemorySize=8Gi | ||
|
||
set +x | ||
set +e | ||
set +o pipefail |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/bash | ||
|
||
ROOT=$(dirname "${BASH_SOURCE[0]}")/.. | ||
|
||
helm uninstall vineyard -n vineyard-system | ||
|
||
kubectl -n vineyard-system delete localobjects --all 2>/dev/null || true | ||
kubectl -n vineyard-system delete globalobjects --all 2>/dev/null || true | ||
|
||
set +x | ||
set +e | ||
set +o pipefail |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.