Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ml_solar_plates
modern_pipeline
Modern Pipeline
Commits
6d30dcb1
Commit
6d30dcb1
authored
Oct 22, 2021
by
Yori Fournier
Browse files
finishing reforge of run_step.sh
parent
fb1b9670
Changes
1
Hide whitespace changes
Inline
Side-by-side
bin/run_step.sh
View file @
6d30dcb1
...
...
@@ -38,30 +38,30 @@ touch ${TMP_DIR}/parameters_checksum.sha1
# set the BUILD HASH
set_build_hash
${
STEP_NAME
}
${
COMMIT
}
echo
"build_hash =
\"
${
BUILD_HASH
}
\"
"
#
>> ${TMP_DIR}/trace.toml
echo
"build_hash =
\"
${
BUILD_HASH
}
\"
"
>>
${
TMP_DIR
}
/trace.toml
# set the PARAM HASH
set_param_hash
${
STEP_NAME
}
${
TMP_DIR
}
echo
"parameters_hash =
\"
${
PARAM_HASH
}
\"
"
#
>> ${TMP_DIR}/trace.toml
echo
"parameters_hash =
\"
${
PARAM_HASH
}
\"
"
>>
${
TMP_DIR
}
/trace.toml
# Set the ARCHIVES HASH
set_archives_hash
${
STEP_NAME
}
${
TMP_DIR
}
echo
"archives_hash =
\"
${
ARCHIVES_HASH
}
\"
"
#
>> ${TMP_DIR}/trace.toml
echo
"archives_hash =
\"
${
ARCHIVES_HASH
}
\"
"
>>
${
TMP_DIR
}
/trace.toml
# Set the STEP HASH
STEP_HASH_ID
=
"
$(
get_hash_from_word
${
BUILD_HASH
}
)
-
$(
get_hash_from_word
${
PARAM_HASH
}
)
-
$(
get_hash_from_word
${
ARCHIVES_HASH
}
)
"
STEP_HASH
=
$(
gen_hash_word
--seed
=
${
STEP_HASH_ID
}
)
echo
"step_id =
\"
${
STEP_HASH_ID
}
\"
"
#
>> ${TMP_DIR}/trace.toml
echo
"step_hash =
\"
${
STEP_HASH
}
\"
"
#
>> ${TMP_DIR}/trace.toml
echo
"step_id =
\"
${
STEP_HASH_ID
}
\"
"
>>
${
TMP_DIR
}
/trace.toml
echo
"step_hash =
\"
${
STEP_HASH
}
\"
"
>>
${
TMP_DIR
}
/trace.toml
# Set the DEPS_HASH
set_deps_hash
${
TMP_DIR
}
${
DEPS_DIR
[@]
}
echo
"dep_id =
\"
${
DEPS_ID
}
\"
"
#
>> ${TMP_DIR}/trace.toml
echo
"deps_hash =
\"
${
DEPS_HASH
}
\"
"
#
>> ${TMP_DIR}/trace.toml
echo
"dep_id =
\"
${
DEPS_ID
}
\"
"
>>
${
TMP_DIR
}
/trace.toml
echo
"deps_hash =
\"
${
DEPS_HASH
}
\"
"
>>
${
TMP_DIR
}
/trace.toml
# Set TMP ARTIFACT HASH
ARTIFACT_HASH
=
"00000000"
...
...
@@ -75,7 +75,7 @@ STEP_DIR_NAME="${STEP_NAME}-${short_deps_hash}-${short_step_hash}"
echo
"DIR NAME:
${
STEP_DIR_NAME
}
"
#
# THIS SHOULD GO IN RUN_PIPELINE !!
# THIS SHOULD GO IN RUN_PIPELINE !!
or be ignore by a --force option
#
# look in the artifacts directory if the step already exists
ls
-d
${
PIPE_ROOT
}
/
${
ARTIFACTS
}
/
${
STEP_DIR_NAME
}*
&> /dev/null
...
...
@@ -107,13 +107,21 @@ fi;
# run the step if it does not exist
#
ARTIFACT_HASH=$(gen_hash_word --seed ${STEP_DIR_NAME})
ARTIFACT_HASH
=
$(
gen_hash_word
)
echo
"artifact_hash =
\"
${
ARTIFACT_HASH
}
\"
"
#
>> ${TMP_DIR}/trace.toml
ARTIFACT_HASH
=
$(
gen_hash_word
--seed
${
STEP_DIR_NAME
}
)
#
ARTIFACT_HASH=$(gen_hash_word)
echo
"artifact_hash =
\"
${
ARTIFACT_HASH
}
\"
"
>>
${
TMP_DIR
}
/trace.toml
# add the dependancies to the trace
cat
${
TMP_DIR
}
/trace_deps.toml
>>
${
TMP_DIR
}
/trace.toml
# copy the parameters to the artifacts
mkdir
${
TMP_DIR
}
/runtime-parameters
cp
-r
${
PIPE_ROOT
}
/
${
RUNTIME_PARAMS
}
/
${
STEP_NAME
}
${
TMP_DIR
}
/runtime-parameters
# copy the image to the artifacts
mkdir
${
TMP_DIR
}
/docker-image
cp
${
PIPE_ROOT
}
/
${
IMAGES_ARCH
}
/
${
STEP_NAME
}
_
${
COMMIT
}
.tar
${
TMP_DIR
}
/docker-image/
# rename the folder with the artifact short-hash
short_deps_hash
=
$(
get_short_hash_from_word
${
DEPS_HASH
}
)
short_step_hash
=
$(
get_short_hash_from_word
${
STEP_HASH
}
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment