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

repo-sync-2024-03-19T14:31:05+0800 #41

Merged
merged 1 commit into from
Mar 22, 2024
Merged
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
5 changes: 1 addition & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -35,9 +35,6 @@ jobs:
steps:
- checkout
- setup_remote_docker
- run:
name: Test
command: make test
- run:
name: Build Docker image
command: make image
@@ -67,4 +64,4 @@ workflows:
tags:
only: /^v.*/
branches:
ignore: /.*/
ignore: /.*/
101 changes: 43 additions & 58 deletions scripts/pack/install.sh
Original file line number Diff line number Diff line change
@@ -141,10 +141,6 @@ function init_images_from_files() {
SECRETPAD_IMAGE=$someimage
elif [[ $someimage == *secretflow-lite* ]]; then
SECRETFLOW_IMAGE=$someimage
elif [[ $someimage == *sf-dev-anolis8* ]]; then
SECRETFLOW_IMAGE=$someimage
elif [[ $someimage == *secretflow-* ]]; then
SECRETFLOW_IMAGE=$someimage
elif [[ $someimage == *sf-tee-dm-sim* ]]; then
TEE_DM_IMAGE=$someimage
elif [[ $someimage == *capsule-manager-sim* ]]; then
@@ -210,63 +206,52 @@ function start_p2p_secretpad() {
echo "bash $(pwd)/start_p2p.sh ${edge_opt}"
bash $(pwd)/start_p2p.sh ${edge_opt}
}

function check_sf_image() {
local domain_id=$1
local domain_ctr=$2
local sf_image=$3

if docker exec -it $domain_ctr crictl inspecti $sf_image >/dev/null 2>&1; then
echo "Image '${sf_image}' already exists in domain '${domain_id}'"
return
fi

local has_sf_image=false
if docker image inspect ${sf_image} >/dev/null 2>&1; then
has_sf_image=true
fi

if [ "$has_sf_image" == true ]; then
echo "Found the image '${sf_image}' on host"
else
echo "Not found the image '${sf_image}' on host"
echo "Start pulling image '${sf_image}' ..."
docker pull ${sf_image}
fi

echo "Start importing image '${sf_image}' Please be patient..."
local image_id
image_id=$(docker images --filter="reference=${sf_image}" --format "{{.ID}}")
echo "'${sf_image}' image_id $image_id"
local image_tar
image_tar=/tmp/$(echo ${sf_image} | sed 's/\//_/g').${image_id}.tar
if [ ! -e $image_tar ]; then
echo "docker save '${sf_image}' $image_tar"
docker save $sf_image -o $image_tar
fi
local CTR_ROOT=/home/kuscia
docker exec -it $domain_ctr ctr -a=${CTR_ROOT}/containerd/run/containerd.sock -n=k8s.io images import $image_tar
echo "Successfully imported image '${sf_image}' to container '${domain_ctr}' ..."
}

function loadTeeDmImage2Container() {
local image_tar
for file in images/*; do
if [ -f "$file" ]; then
someimage=$(basename "$file")
echo "echo ${someimage}"
if [[ $someimage == *sf-tee-dm-sim* ]]; then
tee_dm_image_tar=$someimage
cp images/$tee_dm_image_tar /tmp/$tee_dm_image_tar
image_tar=/tmp/$tee_dm_image_tar
fi
fi
done
echo "Start importing image '${TEE_DM_IMAGE}' Please be patient..."
if [ -n "$image_tar" ]; then
echo "load by local image"
else
docker pull ${TEE_DM_IMAGE}
local image_id
image_id=$(docker images --filter="reference=${TEE_DM_IMAGE}" --format "{{.ID}}")
image_tar=/tmp/$(echo ${TEE_DM_IMAGE} | sed 's/\//_/g').${image_id}.tar
fi
if [ ! -e $image_tar ]; then
docker save $TEE_DM_IMAGE -o $image_tar
fi
local container_id=$1
local CTR_ROOT=/home/kuscia
docker exec -it $container_id ctr -a=${CTR_ROOT}/containerd/run/containerd.sock -n=k8s.io images import $image_tar
local ctr=$1
check_sf_image $ctr ${ctr} ${TEE_DM_IMAGE}
}
function loadSfServingImage2Container() {
local image_tar
for file in images/*; do
if [ -f "$file" ]; then
someimage=$(basename "$file")
echo "echo ${someimage}"
if [[ $someimage == *serving-anolis8* ]]; then
serving_image_tar=$someimage
cp images/$serving_image_tar /tmp/$serving_image_tar
image_tar=/tmp/$serving_image_tar
fi
fi
done
echo "Start importing image '${SECRETFLOW_SERVING_IMAGE}' Please be patient..."
if [ -n "$image_tar" ]; then
echo "load by local image"
else
docker pull ${SECRETFLOW_SERVING_IMAGE}
local image_id
image_id=$(docker images --filter="reference=${SECRETFLOW_SERVING_IMAGE}" --format "{{.ID}}")
image_tar=/tmp/$(echo ${SECRETFLOW_SERVING_IMAGE} | sed 's/\//_/g').${image_id}.tar
fi
if [ ! -e $image_tar ]; then
docker save $SECRETFLOW_SERVING_IMAGE -o $image_tar
fi
local container_id=$1
local CTR_ROOT=/home/kuscia
docker exec -it $container_id ctr -a=${CTR_ROOT}/containerd/run/containerd.sock -n=k8s.io images import $image_tar
local ctr=$1
check_sf_image $ctr ${ctr} ${SECRETFLOW_SERVING_IMAGE}
}
function start_lite() {
# deploy lite
2 changes: 1 addition & 1 deletion scripts/pack/pack_allinone.sh
Original file line number Diff line number Diff line change
@@ -102,7 +102,7 @@ log "docker pull ${SECRETPAD_IMAGE} done"
echo "docker pull ${SECRETFLOW_IMAGE}"
docker pull ${SECRETFLOW_IMAGE}
log "docker pull ${SECRETFLOW_IMAGE} done"
docker pull ${SECRETFLOW_SERVING_IMAGE}
docker pull --platform=linux/amd64 ${SECRETFLOW_SERVING_IMAGE}
log "docker pull ${SECRETFLOW_SERVING_IMAGE} done"

# tee
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*
* Copyright 2023 Ant Group Co., Ltd.
*
* 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
* 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
*
Original file line number Diff line number Diff line change
@@ -608,6 +608,9 @@ public GraphStatus getLatestTaskStatus(ProjectGraphDO graphDO) {
for (String graphNodeId : graphNodeIds) {
GraphNodeStatusVO nodeStatusVO = new GraphNodeStatusVO();
nodeStatusVO.setGraphNodeId(graphNodeId);
// task is top 1 ,but this time graphNode may be changed
// the task work time must be > graphNode update_time
// graphNode update_time may x.y ,ignore x,y change update_time
Optional<ProjectTaskDO> taskDOOptional = taskRepository.findLatestTasks(projectId, graphNodeId);
GraphNodeTaskStatus status = GraphNodeTaskStatus.STAGING;
if (taskDOOptional.isPresent()) {