Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
2
2024-files
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MUDE
2024-files
Commits
f3b13fa1
Commit
f3b13fa1
authored
4 months ago
by
Kwangjin Lee
Browse files
Options
Downloads
Patches
Plain Diff
fix the error
parent
58bf7fa4
No related branches found
No related tags found
No related merge requests found
Pipeline
#261162
passed
4 months ago
Stage: setup
Stage: sync
Stage: update_repo
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitlab-ci.yml
+36
-5
36 additions, 5 deletions
.gitlab-ci.yml
content/test
+0
-0
0 additions, 0 deletions
content/test
with
36 additions
and
5 deletions
.gitlab-ci.yml
+
36
−
5
View file @
f3b13fa1
...
...
@@ -45,6 +45,9 @@ sync_notebooks:
# Create a manifest of all notebooks in content directory
-
find ./content -name "*.ipynb" > notebooks_manifest.txt
# Create an error log file
-
touch conversion_errors.log
-
found_files=false
-
|
while IFS= read -r notebook || [ -n "$notebook" ]; do
...
...
@@ -55,24 +58,50 @@ sync_notebooks:
synced_dir="synced_files/$(dirname $relative_path)"
mkdir -p "$synced_dir"
jupytext --to notebook "$notebook" -o "${synced_dir}/$(basename ${notebook%.ipynb}).ipynb"
jupytext --to markdown "$notebook" -o "${synced_dir}/$(basename ${notebook%.ipynb}).md"
jupytext --to py:percent "$notebook" -o "${synced_dir}/$(basename ${notebook%.ipynb}).py"
jupyter nbconvert --ClearOutputPreprocessor.enabled=True --to notebook --inplace "${synced_dir}/$(basename $notebook)"
# Validate notebook JSON structure
if python -c "import json; json.load(open('$notebook'));" 2>/dev/null; then
# Try conversion with error handling
if jupytext --to notebook "$notebook" -o "${synced_dir}/$(basename ${notebook%.ipynb}).ipynb" 2>>conversion_errors.log && \
jupytext --to markdown "$notebook" -o "${synced_dir}/$(basename ${notebook%.ipynb}).md" 2>>conversion_errors.log && \
jupytext --to py:percent "$notebook" -o "${synced_dir}/$(basename ${notebook%.ipynb}).py" 2>>conversion_errors.log; then
jupyter nbconvert --ClearOutputPreprocessor.enabled=True --to notebook --inplace "${synced_dir}/$(basename $notebook)" 2>>conversion_errors.log
echo "Successfully processed $notebook" >> conversion_errors.log
else
echo "Error processing $notebook - See conversion_errors.log for details" >&2
echo "Failed to convert $notebook" >> conversion_errors.log
fi
else
echo "Invalid or corrupted notebook: $notebook" >> conversion_errors.log
echo "Skipping invalid notebook: $notebook" >&2
fi
fi
done < notebooks_manifest.txt
if [ "$found_files" = false ]; then
echo "No notebooks found in content directory"
echo "No notebooks found in content directory" >> conversion_errors.log
fi
# Check if there were any conversion errors but some files were processed
if [ -s conversion_errors.log ] && [ -d "synced_files" ] && [ "$(ls -A synced_files)" ]; then
echo "Some files had conversion errors but others were processed successfully"
cat conversion_errors.log
exit 0
elif [ ! -d "synced_files" ] || [ ! "$(ls -A synced_files)" ]; then
echo "No files were successfully processed"
cat conversion_errors.log
exit 1
fi
artifacts
:
paths
:
-
synced_files/
-
notebooks_manifest.txt
-
conversion_errors.log
expire_in
:
1 hour
when
:
on_success
reports
:
junit
:
conversion_errors.log
update_repo
:
stage
:
update_repo
...
...
@@ -117,6 +146,8 @@ update_repo:
exit 1
fi
# Deploy stages remain unchanged
deploy-draft-students
:
stage
:
deploy
extends
:
.setup_env
...
...
This diff is collapsed.
Click to expand it.
content/test
deleted
100644 → 0
+
0
−
0
View file @
58bf7fa4
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment