sdg-hub 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- sdg_hub-0.1.0/.github/actionlint.yaml +3 -0
- sdg_hub-0.1.0/.github/actions/free-disk-space/action.yml +19 -0
- sdg_hub-0.1.0/.github/dependabot.yml +21 -0
- sdg_hub-0.1.0/.github/mergify.yml +75 -0
- sdg_hub-0.1.0/.github/workflows/actionlint.dockerfile +3 -0
- sdg_hub-0.1.0/.github/workflows/actionlint.yml +47 -0
- sdg_hub-0.1.0/.github/workflows/docs.yml +44 -0
- sdg_hub-0.1.0/.github/workflows/e2e.yml +103 -0
- sdg_hub-0.1.0/.github/workflows/lint.yml +69 -0
- sdg_hub-0.1.0/.github/workflows/matchers/actionlint.json +18 -0
- sdg_hub-0.1.0/.github/workflows/matchers/pylint.json +33 -0
- sdg_hub-0.1.0/.github/workflows/pypi.yaml +133 -0
- sdg_hub-0.1.0/.github/workflows/test.yml +124 -0
- sdg_hub-0.1.0/.gitignore +171 -0
- sdg_hub-0.1.0/.isort.cfg +10 -0
- sdg_hub-0.1.0/.markdownlint-cli2.yaml +21 -0
- sdg_hub-0.1.0/.pre-commit-config.yaml +16 -0
- sdg_hub-0.1.0/.pylintrc +649 -0
- sdg_hub-0.1.0/CLAUDE.md +90 -0
- sdg_hub-0.1.0/CONTRIBUTING.md +30 -0
- sdg_hub-0.1.0/LICENSE +201 -0
- sdg_hub-0.1.0/MANIFEST.in +2 -0
- sdg_hub-0.1.0/Makefile +59 -0
- sdg_hub-0.1.0/PKG-INFO +190 -0
- sdg_hub-0.1.0/README.md +131 -0
- sdg_hub-0.1.0/assets/imgs/IL_skills_pipeline.png +0 -0
- sdg_hub-0.1.0/assets/imgs/fig-workflow.png +0 -0
- sdg_hub-0.1.0/assets/imgs/instructlab-banner.png +0 -0
- sdg_hub-0.1.0/assets/imgs/overview.png +0 -0
- sdg_hub-0.1.0/docs/.nojekyll +0 -0
- sdg_hub-0.1.0/docs/README.md +51 -0
- sdg_hub-0.1.0/docs/_coverpage.md +11 -0
- sdg_hub-0.1.0/docs/_navbar.md +5 -0
- sdg_hub-0.1.0/docs/_sidebar.md +23 -0
- sdg_hub-0.1.0/docs/architecture.md +149 -0
- sdg_hub-0.1.0/docs/blocks.md +359 -0
- sdg_hub-0.1.0/docs/changelog.md +82 -0
- sdg_hub-0.1.0/docs/development.md +367 -0
- sdg_hub-0.1.0/docs/examples.md +191 -0
- sdg_hub-0.1.0/docs/index.html +47 -0
- sdg_hub-0.1.0/docs/installation.md +100 -0
- sdg_hub-0.1.0/docs/prompts.md +370 -0
- sdg_hub-0.1.0/docs/quick-start.md +116 -0
- sdg_hub-0.1.0/docs/web-interface.md +230 -0
- sdg_hub-0.1.0/examples/knowledge_tuning/data-generation-with-llama-70b/data-generation-with-llama-70b.ipynb +340 -0
- sdg_hub-0.1.0/examples/knowledge_tuning/data-generation-with-llama-70b/synth_knowledge1.5_llama3.3.yaml +136 -0
- sdg_hub-0.1.0/examples/knowledge_tuning/instructlab/docparser.py +77 -0
- sdg_hub-0.1.0/examples/knowledge_tuning/instructlab/docparser_v2.py +204 -0
- sdg_hub-0.1.0/examples/knowledge_tuning/instructlab/document_collection/ibm-annual-report/ibm-annual-report-2024.json +1 -0
- sdg_hub-0.1.0/examples/knowledge_tuning/instructlab/document_collection/ibm-annual-report/ibm-annual-report-2024.md +5085 -0
- sdg_hub-0.1.0/examples/knowledge_tuning/instructlab/document_collection/ibm-annual-report/ibm-annual-report-2024.pdf +0 -0
- sdg_hub-0.1.0/examples/knowledge_tuning/instructlab/document_collection/ibm-annual-report/qna.yaml +100 -0
- sdg_hub-0.1.0/examples/knowledge_tuning/instructlab/document_pre_processing.ipynb +113 -0
- sdg_hub-0.1.0/examples/knowledge_tuning/instructlab/knowledge_generation_and_mixing.ipynb +197 -0
- sdg_hub-0.1.0/examples/knowledge_tuning/knowledge_tuning_with_reasoning_model/README.md +311 -0
- sdg_hub-0.1.0/examples/knowledge_tuning/knowledge_tuning_with_reasoning_model/assets/customized_nano_quality_results.png +0 -0
- sdg_hub-0.1.0/examples/knowledge_tuning/knowledge_tuning_with_reasoning_model/blocks/blocks.py +60 -0
- sdg_hub-0.1.0/examples/knowledge_tuning/knowledge_tuning_with_reasoning_model/flows/synth_knowledge1.5_nemotron_super_49b.yaml +174 -0
- sdg_hub-0.1.0/examples/knowledge_tuning/knowledge_tuning_with_reasoning_model/flows/synth_knowledge_reasoning_nemotron_super_49b.yaml +178 -0
- sdg_hub-0.1.0/examples/knowledge_tuning/knowledge_tuning_with_reasoning_model/flows/synth_knowledge_reasoning_nemotron_super_49b_rewrite_with_diversity.yaml +118 -0
- sdg_hub-0.1.0/examples/knowledge_tuning/knowledge_tuning_with_reasoning_model/flows/synth_knowledge_reasoning_nemotron_super_49b_summary_diversity.yaml +118 -0
- sdg_hub-0.1.0/examples/knowledge_tuning/knowledge_tuning_with_reasoning_model/flows/synth_knowledge_reasoning_nemotron_super_49b_summary_diversity_cot.yaml +118 -0
- sdg_hub-0.1.0/examples/knowledge_tuning/knowledge_tuning_with_reasoning_model/generate.py +194 -0
- sdg_hub-0.1.0/examples/knowledge_tuning/knowledge_tuning_with_reasoning_model/prompts/generate_answers.yaml +51 -0
- sdg_hub-0.1.0/examples/knowledge_tuning/knowledge_tuning_with_reasoning_model/prompts/generate_answers_cot.yaml +31 -0
- sdg_hub-0.1.0/examples/knowledge_tuning/knowledge_tuning_with_reasoning_model/prompts/generate_doc_rewrite_inst.yaml +25 -0
- sdg_hub-0.1.0/examples/knowledge_tuning/knowledge_tuning_with_reasoning_model/prompts/generate_document_rewrite.yaml +20 -0
- sdg_hub-0.1.0/examples/knowledge_tuning/knowledge_tuning_with_reasoning_model/prompts/generate_questions.yaml +47 -0
- sdg_hub-0.1.0/examples/knowledge_tuning/knowledge_tuning_with_reasoning_model/prompts/generate_questions_responses.yaml +59 -0
- sdg_hub-0.1.0/examples/knowledge_tuning/knowledge_tuning_with_reasoning_model/prompts/generate_summary.yaml +20 -0
- sdg_hub-0.1.0/examples/knowledge_tuning/knowledge_tuning_with_reasoning_model/prompts/generate_summary_inst.yaml +24 -0
- sdg_hub-0.1.0/examples/knowledge_tuning/knowledge_tuning_with_reasoning_model/reasoning_sdg_financebench.ipynb +1078 -0
- sdg_hub-0.1.0/examples/knowledge_tuning/knowledge_tuning_with_reasoning_model/reasoning_sdg_quality.ipynb +935 -0
- sdg_hub-0.1.0/examples/knowledge_tuning/knowledge_tuning_with_reasoning_model/utils.py +121 -0
- sdg_hub-0.1.0/examples/knowledge_tuning/knowledge_utils.py +643 -0
- sdg_hub-0.1.0/examples/skills_tuning/instructlab/README.md +118 -0
- sdg_hub-0.1.0/examples/skills_tuning/instructlab/annotation_classification.ipynb +544 -0
- sdg_hub-0.1.0/examples/skills_tuning/instructlab/blocks/__init__.py +3 -0
- sdg_hub-0.1.0/examples/skills_tuning/instructlab/blocks/add_question.py +91 -0
- sdg_hub-0.1.0/examples/skills_tuning/instructlab/blocks/docling_parse_pdf.py +91 -0
- sdg_hub-0.1.0/examples/skills_tuning/instructlab/blocks/json_format.py +133 -0
- sdg_hub-0.1.0/examples/skills_tuning/instructlab/flows/detailed_annotation.yaml +16 -0
- sdg_hub-0.1.0/examples/skills_tuning/instructlab/flows/grounded_summary_extraction.yaml +53 -0
- sdg_hub-0.1.0/examples/skills_tuning/instructlab/flows/simple_annotation.yaml +16 -0
- sdg_hub-0.1.0/examples/skills_tuning/instructlab/flows/unstructured_to_structured.yaml +47 -0
- sdg_hub-0.1.0/examples/skills_tuning/instructlab/prompts/keywords.yaml +29 -0
- sdg_hub-0.1.0/examples/skills_tuning/instructlab/prompts/named_entities.yaml +40 -0
- sdg_hub-0.1.0/examples/skills_tuning/instructlab/prompts/sentiment.yaml +28 -0
- sdg_hub-0.1.0/examples/skills_tuning/instructlab/prompts/summary.yaml +29 -0
- sdg_hub-0.1.0/examples/skills_tuning/instructlab/seed_data/financial_call_transcripts/09b5b62d328d3d0719b6825357fdfb48.pdf +169 -0
- sdg_hub-0.1.0/examples/skills_tuning/instructlab/seed_data/financial_call_transcripts/0d631e444d1c22f0be99a69f5deaff94.pdf +112 -0
- sdg_hub-0.1.0/examples/skills_tuning/instructlab/seed_data/financial_call_transcripts/1270f7f67f406b52a2ee86584b452bff.pdf +74 -0
- sdg_hub-0.1.0/examples/skills_tuning/instructlab/seed_data/financial_call_transcripts/14f3d2486b21e639a953afb7ad03d90c.pdf +112 -0
- sdg_hub-0.1.0/examples/skills_tuning/instructlab/seed_data/financial_call_transcripts/1689b94530eca82b7758c86b4cf3125f.pdf +112 -0
- sdg_hub-0.1.0/examples/skills_tuning/instructlab/seed_data/financial_call_transcripts/171fd9df333ddd814c764843ed624121.pdf +150 -0
- sdg_hub-0.1.0/examples/skills_tuning/instructlab/seed_data/financial_call_transcripts/1949bd0c9c4c23d495d880c4c552bfe1.pdf +131 -0
- sdg_hub-0.1.0/examples/skills_tuning/instructlab/seed_data/financial_call_transcripts/2b626b620ef42f716c6028c74ee4187b.pdf +74 -0
- sdg_hub-0.1.0/examples/skills_tuning/instructlab/seed_data/financial_call_transcripts/3877b1983229ec488c6349a188bccf92.pdf +207 -0
- sdg_hub-0.1.0/examples/skills_tuning/instructlab/seed_data/financial_call_transcripts/3bc6d3e1c0a117340d288c289bf7f679.pdf +93 -0
- sdg_hub-0.1.0/examples/skills_tuning/instructlab/seed_data/financial_call_transcripts/3e714a49937be1672aa48244ba7254ce.pdf +74 -0
- sdg_hub-0.1.0/examples/skills_tuning/instructlab/seed_data/financial_call_transcripts/6064088db0200b32f3f3e848047c5ab6.pdf +74 -0
- sdg_hub-0.1.0/examples/skills_tuning/instructlab/seed_data/financial_call_transcripts/73c60e60043b8775dac929320839a8c6.pdf +93 -0
- sdg_hub-0.1.0/examples/skills_tuning/instructlab/seed_data/financial_call_transcripts/77423f08f0208d476dea73c639f6293a.pdf +169 -0
- sdg_hub-0.1.0/examples/skills_tuning/instructlab/seed_data/financial_call_transcripts/78cf0d3e40caba622d8914916f0f9146.pdf +93 -0
- sdg_hub-0.1.0/examples/skills_tuning/instructlab/seed_data/financial_call_transcripts/7a29e2dcd505f944b16d1e3173cb1c01.pdf +93 -0
- sdg_hub-0.1.0/examples/skills_tuning/instructlab/seed_data/financial_call_transcripts/8c1b4f4af2af2847a240041390e31399.pdf +93 -0
- sdg_hub-0.1.0/examples/skills_tuning/instructlab/seed_data/financial_call_transcripts/8cd753ed00aeee0ed32d03823eef3f7e.pdf +93 -0
- sdg_hub-0.1.0/examples/skills_tuning/instructlab/seed_data/financial_call_transcripts/a24a661c2eb55542903c72391ec09f9b.pdf +112 -0
- sdg_hub-0.1.0/examples/skills_tuning/instructlab/seed_data/financial_call_transcripts/b3d7bc295d09d9927e465213612c0192.pdf +150 -0
- sdg_hub-0.1.0/examples/skills_tuning/instructlab/seed_data/financial_call_transcripts/b7050f62f52a3d2803beea21404f7af6.pdf +112 -0
- sdg_hub-0.1.0/examples/skills_tuning/instructlab/seed_data/financial_call_transcripts/b9b40b0c1e92fb226067bdceacbdab5c.pdf +74 -0
- sdg_hub-0.1.0/examples/skills_tuning/instructlab/seed_data/financial_call_transcripts/c20824ea6f927fe380f48a904cf4821b.pdf +93 -0
- sdg_hub-0.1.0/examples/skills_tuning/instructlab/seed_data/financial_call_transcripts/c2bad61ce58687fad602549f6048004b.pdf +93 -0
- sdg_hub-0.1.0/examples/skills_tuning/instructlab/seed_data/financial_call_transcripts/c47a92e006b54d014a79b447528c55a7.pdf +112 -0
- sdg_hub-0.1.0/examples/skills_tuning/instructlab/seed_data/financial_call_transcripts/da879f8ea1c23aa6565cccaacac271fc.pdf +169 -0
- sdg_hub-0.1.0/examples/skills_tuning/instructlab/seed_data/financial_call_transcripts/e52e6870e8a04339ef969543fc0f0329.pdf +74 -0
- sdg_hub-0.1.0/examples/skills_tuning/instructlab/seed_data/financial_call_transcripts/ecd8e1f1c0fa27dfdd24b358cb65012f.pdf +74 -0
- sdg_hub-0.1.0/examples/skills_tuning/instructlab/seed_data/financial_call_transcripts/f28832481653818f8062a497655fb09e.pdf +74 -0
- sdg_hub-0.1.0/examples/skills_tuning/instructlab/seed_data/financial_call_transcripts/ff898f396d49760343d08575ea773b54.pdf +93 -0
- sdg_hub-0.1.0/examples/skills_tuning/instructlab/seed_data/financial_call_transcripts.jsonl +30 -0
- sdg_hub-0.1.0/examples/skills_tuning/instructlab/seed_data/table_manipulation_qna.yaml +97 -0
- sdg_hub-0.1.0/examples/skills_tuning/instructlab/seed_data/unstructured_to_structured_qna.yaml +49 -0
- sdg_hub-0.1.0/examples/skills_tuning/instructlab/structured_summary.ipynb +375 -0
- sdg_hub-0.1.0/examples/skills_tuning/instructlab/table_manipulation.ipynb +1036 -0
- sdg_hub-0.1.0/examples/skills_tuning/instructlab/unstructured_to_structured.ipynb +516 -0
- sdg_hub-0.1.0/pyproject.toml +146 -0
- sdg_hub-0.1.0/scripts/__init__.py +0 -0
- sdg_hub-0.1.0/scripts/ruff.sh +54 -0
- sdg_hub-0.1.0/setup.cfg +4 -0
- sdg_hub-0.1.0/src/sdg_hub/__init__.py +3 -0
- sdg_hub-0.1.0/src/sdg_hub/_version.py +21 -0
- sdg_hub-0.1.0/src/sdg_hub/blocks/__init__.py +36 -0
- sdg_hub-0.1.0/src/sdg_hub/blocks/block.py +96 -0
- sdg_hub-0.1.0/src/sdg_hub/blocks/llmblock.py +375 -0
- sdg_hub-0.1.0/src/sdg_hub/blocks/utilblocks.py +597 -0
- sdg_hub-0.1.0/src/sdg_hub/checkpointer.py +139 -0
- sdg_hub-0.1.0/src/sdg_hub/configs/__init__.py +0 -0
- sdg_hub-0.1.0/src/sdg_hub/configs/annotations/__init__.py +0 -0
- sdg_hub-0.1.0/src/sdg_hub/configs/annotations/cot_reflection.yaml +34 -0
- sdg_hub-0.1.0/src/sdg_hub/configs/annotations/detailed_annotations.yaml +28 -0
- sdg_hub-0.1.0/src/sdg_hub/configs/annotations/detailed_description.yaml +10 -0
- sdg_hub-0.1.0/src/sdg_hub/configs/annotations/detailed_description_icl.yaml +32 -0
- sdg_hub-0.1.0/src/sdg_hub/configs/annotations/simple_annotations.yaml +9 -0
- sdg_hub-0.1.0/src/sdg_hub/configs/knowledge/__init__.py +0 -0
- sdg_hub-0.1.0/src/sdg_hub/configs/knowledge/atomic_facts.yaml +45 -0
- sdg_hub-0.1.0/src/sdg_hub/configs/knowledge/auxilary_instructions.yaml +35 -0
- sdg_hub-0.1.0/src/sdg_hub/configs/knowledge/detailed_summary.yaml +17 -0
- sdg_hub-0.1.0/src/sdg_hub/configs/knowledge/evaluate_faithfulness.yaml +68 -0
- sdg_hub-0.1.0/src/sdg_hub/configs/knowledge/evaluate_question.yaml +38 -0
- sdg_hub-0.1.0/src/sdg_hub/configs/knowledge/evaluate_relevancy.yaml +85 -0
- sdg_hub-0.1.0/src/sdg_hub/configs/knowledge/extractive_summary.yaml +17 -0
- sdg_hub-0.1.0/src/sdg_hub/configs/knowledge/generate_code_questions_responses.yaml +39 -0
- sdg_hub-0.1.0/src/sdg_hub/configs/knowledge/generate_questions_responses.yaml +56 -0
- sdg_hub-0.1.0/src/sdg_hub/configs/knowledge/mcq_generation.yaml +83 -0
- sdg_hub-0.1.0/src/sdg_hub/configs/knowledge/router.yaml +12 -0
- sdg_hub-0.1.0/src/sdg_hub/configs/knowledge/simple_generate_qa.yaml +34 -0
- sdg_hub-0.1.0/src/sdg_hub/configs/reasoning/__init__.py +0 -0
- sdg_hub-0.1.0/src/sdg_hub/configs/reasoning/dynamic_cot.yaml +40 -0
- sdg_hub-0.1.0/src/sdg_hub/configs/skills/__init__.py +0 -0
- sdg_hub-0.1.0/src/sdg_hub/configs/skills/analyzer.yaml +48 -0
- sdg_hub-0.1.0/src/sdg_hub/configs/skills/annotation.yaml +36 -0
- sdg_hub-0.1.0/src/sdg_hub/configs/skills/contexts.yaml +28 -0
- sdg_hub-0.1.0/src/sdg_hub/configs/skills/critic.yaml +60 -0
- sdg_hub-0.1.0/src/sdg_hub/configs/skills/evaluate_freeform_pair.yaml +111 -0
- sdg_hub-0.1.0/src/sdg_hub/configs/skills/evaluate_freeform_questions.yaml +78 -0
- sdg_hub-0.1.0/src/sdg_hub/configs/skills/evaluate_grounded_pair.yaml +119 -0
- sdg_hub-0.1.0/src/sdg_hub/configs/skills/evaluate_grounded_questions.yaml +51 -0
- sdg_hub-0.1.0/src/sdg_hub/configs/skills/freeform_questions.yaml +34 -0
- sdg_hub-0.1.0/src/sdg_hub/configs/skills/freeform_responses.yaml +39 -0
- sdg_hub-0.1.0/src/sdg_hub/configs/skills/grounded_questions.yaml +38 -0
- sdg_hub-0.1.0/src/sdg_hub/configs/skills/grounded_responses.yaml +59 -0
- sdg_hub-0.1.0/src/sdg_hub/configs/skills/icl_examples/STEM.yaml +56 -0
- sdg_hub-0.1.0/src/sdg_hub/configs/skills/icl_examples/__init__.py +0 -0
- sdg_hub-0.1.0/src/sdg_hub/configs/skills/icl_examples/coding.yaml +97 -0
- sdg_hub-0.1.0/src/sdg_hub/configs/skills/icl_examples/extraction.yaml +36 -0
- sdg_hub-0.1.0/src/sdg_hub/configs/skills/icl_examples/humanities.yaml +71 -0
- sdg_hub-0.1.0/src/sdg_hub/configs/skills/icl_examples/math.yaml +85 -0
- sdg_hub-0.1.0/src/sdg_hub/configs/skills/icl_examples/reasoning.yaml +30 -0
- sdg_hub-0.1.0/src/sdg_hub/configs/skills/icl_examples/roleplay.yaml +45 -0
- sdg_hub-0.1.0/src/sdg_hub/configs/skills/icl_examples/writing.yaml +80 -0
- sdg_hub-0.1.0/src/sdg_hub/configs/skills/judge.yaml +53 -0
- sdg_hub-0.1.0/src/sdg_hub/configs/skills/planner.yaml +67 -0
- sdg_hub-0.1.0/src/sdg_hub/configs/skills/respond.yaml +8 -0
- sdg_hub-0.1.0/src/sdg_hub/configs/skills/revised_responder.yaml +78 -0
- sdg_hub-0.1.0/src/sdg_hub/configs/skills/router.yaml +59 -0
- sdg_hub-0.1.0/src/sdg_hub/configs/skills/simple_generate_qa_freeform.yaml +27 -0
- sdg_hub-0.1.0/src/sdg_hub/configs/skills/simple_generate_qa_grounded.yaml +31 -0
- sdg_hub-0.1.0/src/sdg_hub/flow.py +306 -0
- sdg_hub-0.1.0/src/sdg_hub/flow_runner.py +204 -0
- sdg_hub-0.1.0/src/sdg_hub/flows/generation/knowledge/mmlu_bench.yaml +13 -0
- sdg_hub-0.1.0/src/sdg_hub/flows/generation/knowledge/simple_knowledge.yaml +12 -0
- sdg_hub-0.1.0/src/sdg_hub/flows/generation/knowledge/synth_knowledge.yaml +89 -0
- sdg_hub-0.1.0/src/sdg_hub/flows/generation/knowledge/synth_knowledge1.5.yaml +136 -0
- sdg_hub-0.1.0/src/sdg_hub/flows/generation/skills/improve_responses.yaml +103 -0
- sdg_hub-0.1.0/src/sdg_hub/flows/generation/skills/simple_freeform_skill.yaml +12 -0
- sdg_hub-0.1.0/src/sdg_hub/flows/generation/skills/simple_grounded_skill.yaml +12 -0
- sdg_hub-0.1.0/src/sdg_hub/flows/generation/skills/synth_grounded_skills.yaml +80 -0
- sdg_hub-0.1.0/src/sdg_hub/flows/generation/skills/synth_skills.yaml +59 -0
- sdg_hub-0.1.0/src/sdg_hub/logger_config.py +20 -0
- sdg_hub-0.1.0/src/sdg_hub/pipeline.py +121 -0
- sdg_hub-0.1.0/src/sdg_hub/prompts.py +43 -0
- sdg_hub-0.1.0/src/sdg_hub/py.typed +0 -0
- sdg_hub-0.1.0/src/sdg_hub/registry.py +122 -0
- sdg_hub-0.1.0/src/sdg_hub/sdg.py +206 -0
- sdg_hub-0.1.0/src/sdg_hub/utils/__init__.py +5 -0
- sdg_hub-0.1.0/src/sdg_hub/utils/datautils.py +14 -0
- sdg_hub-0.1.0/src/sdg_hub.egg-info/PKG-INFO +190 -0
- sdg_hub-0.1.0/src/sdg_hub.egg-info/SOURCES.txt +236 -0
- sdg_hub-0.1.0/src/sdg_hub.egg-info/dependency_links.txt +1 -0
- sdg_hub-0.1.0/src/sdg_hub.egg-info/requires.txt +36 -0
- sdg_hub-0.1.0/src/sdg_hub.egg-info/top_level.txt +1 -0
- sdg_hub-0.1.0/tests/__init__.py +0 -0
- sdg_hub-0.1.0/tests/blocks/test_llmblock.py +343 -0
- sdg_hub-0.1.0/tests/blocks/testdata/test_config.yaml +7 -0
- sdg_hub-0.1.0/tests/blocks/utilblocks/test_combinecolumns.py +166 -0
- sdg_hub-0.1.0/tests/blocks/utilblocks/test_duplicatecolumnsblock.py +112 -0
- sdg_hub-0.1.0/tests/blocks/utilblocks/test_filterblock.py +157 -0
- sdg_hub-0.1.0/tests/blocks/utilblocks/test_flattenblock.py +217 -0
- sdg_hub-0.1.0/tests/blocks/utilblocks/test_renameblock.py +101 -0
- sdg_hub-0.1.0/tests/blocks/utilblocks/test_samplepopulatorblock.py +195 -0
- sdg_hub-0.1.0/tests/blocks/utilblocks/test_selectorblock.py +146 -0
- sdg_hub-0.1.0/tests/blocks/utilblocks/test_settomajority.py +124 -0
- sdg_hub-0.1.0/tests/flows/test_flow.py +221 -0
- sdg_hub-0.1.0/tests/flows/test_flow_path.py +76 -0
- sdg_hub-0.1.0/tests/flows/testdata/test_config_1.yaml +7 -0
- sdg_hub-0.1.0/tests/flows/testdata/test_flow_1.yaml +7 -0
- sdg_hub-0.1.0/tests/flows/testdata/test_flow_2.yaml +10 -0
- sdg_hub-0.1.0/tests/test_checkpointer.py +175 -0
- sdg_hub-0.1.0/tests/test_flowrunner.py +251 -0
- sdg_hub-0.1.0/tests/test_pipeline.py +201 -0
- sdg_hub-0.1.0/tests/test_sdg.py +413 -0
- sdg_hub-0.1.0/tox.ini +70 -0
- sdg_hub-0.1.0/web_interface/README.md +133 -0
- sdg_hub-0.1.0/web_interface/app.py +227 -0
- sdg_hub-0.1.0/web_interface/static/css/style.css +171 -0
- sdg_hub-0.1.0/web_interface/static/js/app.js +518 -0
- sdg_hub-0.1.0/web_interface/templates/index.html +119 -0
- sdg_hub-0.1.0/web_interface/test_block_types.py +75 -0
@@ -0,0 +1,19 @@
|
|
1
|
+
name: 'Free Disk Space'
|
2
|
+
description: 'Frees disk space on the runner'
|
3
|
+
runs:
|
4
|
+
using: "composite"
|
5
|
+
steps:
|
6
|
+
- run: |
|
7
|
+
df -h
|
8
|
+
sudo docker rmi "$(docker image ls -aq)" >/dev/null 2>&1 || true
|
9
|
+
sudo rm -rf \
|
10
|
+
/usr/share/dotnet /usr/local/lib/android /opt/ghc \
|
11
|
+
/usr/local/share/powershell /usr/share/swift /usr/local/.ghcup \
|
12
|
+
/usr/lib/jvm || true
|
13
|
+
sudo apt install aptitude -y >/dev/null 2>&1
|
14
|
+
sudo aptitude purge '~n ^mysql' -f -y >/dev/null 2>&1
|
15
|
+
sudo aptitude purge '~n ^dotnet' -f -y >/dev/null 2>&1
|
16
|
+
sudo apt-get autoremove -y >/dev/null 2>&1
|
17
|
+
sudo apt-get autoclean -y >/dev/null 2>&1
|
18
|
+
df -h
|
19
|
+
shell: bash
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# SPDX-License-Identifier: Apache-2.0
|
2
|
+
|
3
|
+
# GitHub Dependabot configuration file
|
4
|
+
version: 2
|
5
|
+
updates:
|
6
|
+
|
7
|
+
# Maintain dependencies for GitHub Actions
|
8
|
+
- package-ecosystem: "github-actions"
|
9
|
+
directory: "/"
|
10
|
+
schedule:
|
11
|
+
interval: "daily"
|
12
|
+
- package-ecosystem: "docker"
|
13
|
+
directory: "/.github/workflows"
|
14
|
+
schedule:
|
15
|
+
interval: "daily"
|
16
|
+
|
17
|
+
# Maintain dependencies for Python scripts
|
18
|
+
- package-ecosystem: "pip"
|
19
|
+
directory: "/"
|
20
|
+
schedule:
|
21
|
+
interval: "daily"
|
@@ -0,0 +1,75 @@
|
|
1
|
+
pull_request_rules:
|
2
|
+
|
3
|
+
- name: label-cicd
|
4
|
+
description: Automatically apply CI/CD label
|
5
|
+
conditions:
|
6
|
+
- or:
|
7
|
+
- files=.github/mergify.yml
|
8
|
+
- files=.github/workflows/**/*
|
9
|
+
- files=.pylintrc
|
10
|
+
- files=tox.ini
|
11
|
+
- files=.markdownlint-cli2.yaml
|
12
|
+
actions:
|
13
|
+
label:
|
14
|
+
add:
|
15
|
+
- CI/CD
|
16
|
+
|
17
|
+
- name: label-documentation
|
18
|
+
description: Automatically apply documentation label
|
19
|
+
conditions:
|
20
|
+
- or:
|
21
|
+
- files~=.*\.md
|
22
|
+
- files~=docs/.*
|
23
|
+
actions:
|
24
|
+
label:
|
25
|
+
add:
|
26
|
+
- documentation
|
27
|
+
|
28
|
+
- name: label-testing
|
29
|
+
description: Automatically apply testing label
|
30
|
+
conditions:
|
31
|
+
- or:
|
32
|
+
- files~=tests/.*
|
33
|
+
- files=tox.ini
|
34
|
+
actions:
|
35
|
+
label:
|
36
|
+
add:
|
37
|
+
- testing
|
38
|
+
|
39
|
+
- name: ping author on conflicts and add 'needs-rebase' label
|
40
|
+
conditions:
|
41
|
+
- conflict
|
42
|
+
- -closed
|
43
|
+
actions:
|
44
|
+
label:
|
45
|
+
add:
|
46
|
+
- needs-rebase
|
47
|
+
comment:
|
48
|
+
message: |
|
49
|
+
This pull request has merge conflicts that must be resolved before it can be
|
50
|
+
merged. @{{author}} please rebase it. https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork
|
51
|
+
|
52
|
+
- name: remove 'needs-rebase' label when conflict is resolved
|
53
|
+
conditions:
|
54
|
+
- -conflict
|
55
|
+
- -closed
|
56
|
+
actions:
|
57
|
+
label:
|
58
|
+
remove:
|
59
|
+
- needs-rebase
|
60
|
+
|
61
|
+
- name: Apply ci-failure label if any CI checks have failed
|
62
|
+
conditions:
|
63
|
+
- "#check-failure>0"
|
64
|
+
actions:
|
65
|
+
label:
|
66
|
+
add:
|
67
|
+
- ci-failure
|
68
|
+
|
69
|
+
- name: Remove ci-failure label if no failures are present
|
70
|
+
conditions:
|
71
|
+
- "#check-failure=0"
|
72
|
+
actions:
|
73
|
+
label:
|
74
|
+
remove:
|
75
|
+
- ci-failure
|
@@ -0,0 +1,47 @@
|
|
1
|
+
# SPDX-License-Identifier: Apache-2.0
|
2
|
+
|
3
|
+
name: Lint GitHub Actions workflows
|
4
|
+
on:
|
5
|
+
push:
|
6
|
+
branches:
|
7
|
+
- "main"
|
8
|
+
paths:
|
9
|
+
- '.github/workflows/*.ya?ml'
|
10
|
+
- '.github/workflows/actionlint.*' # This workflow
|
11
|
+
pull_request:
|
12
|
+
branches:
|
13
|
+
- "main"
|
14
|
+
paths:
|
15
|
+
- '.github/workflows/*.ya?ml'
|
16
|
+
- '.github/workflows/actionlint.*' # This workflow
|
17
|
+
|
18
|
+
env:
|
19
|
+
LC_ALL: en_US.UTF-8
|
20
|
+
|
21
|
+
defaults:
|
22
|
+
run:
|
23
|
+
shell: bash
|
24
|
+
|
25
|
+
permissions:
|
26
|
+
contents: read
|
27
|
+
|
28
|
+
jobs:
|
29
|
+
actionlint:
|
30
|
+
runs-on: ubuntu-latest
|
31
|
+
steps:
|
32
|
+
- name: "Harden Runner"
|
33
|
+
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
|
34
|
+
with:
|
35
|
+
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
|
36
|
+
|
37
|
+
- name: "Checkout"
|
38
|
+
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
|
39
|
+
|
40
|
+
- name: "Download actionlint"
|
41
|
+
run: |
|
42
|
+
docker build --tag actionlint - < .github/workflows/actionlint.dockerfile
|
43
|
+
|
44
|
+
- name: "Check workflow files"
|
45
|
+
run: |
|
46
|
+
echo "::add-matcher::.github/workflows/matchers/actionlint.json"
|
47
|
+
docker run --volume="${PWD}:/repo" --workdir=/repo actionlint -color
|
@@ -0,0 +1,44 @@
|
|
1
|
+
# SPDX-License-Identifier: Apache-2.0
|
2
|
+
|
3
|
+
name: Lint Markdown documents
|
4
|
+
|
5
|
+
on:
|
6
|
+
push:
|
7
|
+
branches:
|
8
|
+
- "main"
|
9
|
+
paths:
|
10
|
+
- '**/*.md'
|
11
|
+
- '.markdownlint-cli2.yaml'
|
12
|
+
- '.github/workflows/docs.yml' # This workflow
|
13
|
+
pull_request:
|
14
|
+
branches:
|
15
|
+
- "main"
|
16
|
+
paths:
|
17
|
+
- '**/*.md'
|
18
|
+
- '.markdownlint-cli2.yaml'
|
19
|
+
- '.github/workflows/docs.yml' # This workflow
|
20
|
+
|
21
|
+
env:
|
22
|
+
LC_ALL: en_US.UTF-8
|
23
|
+
|
24
|
+
defaults:
|
25
|
+
run:
|
26
|
+
shell: bash
|
27
|
+
|
28
|
+
permissions:
|
29
|
+
contents: read
|
30
|
+
|
31
|
+
jobs:
|
32
|
+
markdown-lint:
|
33
|
+
runs-on: ubuntu-latest
|
34
|
+
steps:
|
35
|
+
- name: "Harden Runner"
|
36
|
+
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
|
37
|
+
with:
|
38
|
+
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
|
39
|
+
- name: "Checkout"
|
40
|
+
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
|
41
|
+
- name: "Check Markdown documents"
|
42
|
+
uses: DavidAnson/markdownlint-cli2-action@992badcdf24e3b8eb7e87ff9287fe931bcb00c6e # v20.0.0
|
43
|
+
with:
|
44
|
+
globs: '**/*.md'
|
@@ -0,0 +1,103 @@
|
|
1
|
+
# SPDX-License-Identifier: Apache-2.0
|
2
|
+
|
3
|
+
name: E2E test
|
4
|
+
|
5
|
+
on:
|
6
|
+
workflow_dispatch:
|
7
|
+
# TODO: e2e workflow set to manual dispatch until it's adjusted to use
|
8
|
+
# AWS GPU runners instead of ubuntu-gpu GitHub runners, since those
|
9
|
+
# GitHub runners are more expensive and not available in this org
|
10
|
+
#
|
11
|
+
# push:
|
12
|
+
# branches:
|
13
|
+
# - "main"
|
14
|
+
# - "release-**"
|
15
|
+
# paths:
|
16
|
+
# - '**.py'
|
17
|
+
# - 'pyproject.toml'
|
18
|
+
# - 'requirements*.txt'
|
19
|
+
# - '.github/workflows/e2e.yml'
|
20
|
+
# pull_request:
|
21
|
+
# branches:
|
22
|
+
# - "main"
|
23
|
+
# - "release-**"
|
24
|
+
# paths:
|
25
|
+
# - '**.py'
|
26
|
+
# - 'pyproject.toml'
|
27
|
+
# - 'requirements*.txt'
|
28
|
+
# - '.github/workflows/e2e.yml'
|
29
|
+
|
30
|
+
jobs:
|
31
|
+
e2e:
|
32
|
+
runs-on: ubuntu-gpu
|
33
|
+
|
34
|
+
permissions:
|
35
|
+
pull-requests: write
|
36
|
+
|
37
|
+
steps:
|
38
|
+
# No step-security/harden-runner since this is a self-hosted runner
|
39
|
+
- name: Checkout instructlab/sdg
|
40
|
+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
41
|
+
with:
|
42
|
+
# https://github.com/actions/checkout/issues/249
|
43
|
+
fetch-depth: 0
|
44
|
+
|
45
|
+
- name: Checkout instructlab/instructlab
|
46
|
+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
47
|
+
with:
|
48
|
+
repository: "instructlab/instructlab"
|
49
|
+
path: "instructlab"
|
50
|
+
fetch-depth: 0
|
51
|
+
|
52
|
+
- name: Install Packages
|
53
|
+
run: |
|
54
|
+
sudo apt-get install -y cuda-toolkit git cmake build-essential
|
55
|
+
nvidia-smi
|
56
|
+
sudo ls -l /dev/nvidia*
|
57
|
+
|
58
|
+
- name: Setup Python 3.11
|
59
|
+
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
|
60
|
+
with:
|
61
|
+
python-version: 3.11
|
62
|
+
cache: pip
|
63
|
+
cache-dependency-path: |
|
64
|
+
**/pyproject.toml
|
65
|
+
**/requirements*.txt
|
66
|
+
|
67
|
+
- name: Remove llama-cpp-python from cache
|
68
|
+
run: |
|
69
|
+
pip cache remove llama_cpp_python
|
70
|
+
|
71
|
+
- name: Cache huggingface
|
72
|
+
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
|
73
|
+
with:
|
74
|
+
path: ~/.cache/huggingface
|
75
|
+
# config contains DEFAULT_MODEL
|
76
|
+
key: huggingface-${{ hashFiles('src/instructlab/configuration.py') }}
|
77
|
+
|
78
|
+
- name: Install instructlab and sdg_hub
|
79
|
+
run: |
|
80
|
+
export PATH="/home/runner/.local/bin:/usr/local/cuda/bin:$PATH"
|
81
|
+
python3 -m venv venv
|
82
|
+
. venv/bin/activate
|
83
|
+
cd instructlab
|
84
|
+
sed 's/\[.*\]//' requirements.txt > constraints.txt
|
85
|
+
python3 -m pip cache remove llama_cpp_python
|
86
|
+
CMAKE_ARGS="-DLLAMA_CUBLAS=on" python3 -m pip install --no-binary llama_cpp_python -c constraints.txt llama_cpp_python
|
87
|
+
# needed for --4-bit-quant option to ilab train
|
88
|
+
python3 -m pip install bitsandbytes
|
89
|
+
# install instructlab
|
90
|
+
python3 -m pip install .
|
91
|
+
cd ..
|
92
|
+
# Install sdg_hub
|
93
|
+
python3 -m pip install .
|
94
|
+
|
95
|
+
- name: Run e2e test
|
96
|
+
run: |
|
97
|
+
. venv/bin/activate
|
98
|
+
./instructlab/scripts/basic-workflow-tests.sh -cm
|
99
|
+
|
100
|
+
- name: Remove llama-cpp-python from cache
|
101
|
+
if: always()
|
102
|
+
run: |
|
103
|
+
pip cache remove llama_cpp_python
|
@@ -0,0 +1,69 @@
|
|
1
|
+
# SPDX-License-Identifier: Apache-2.0
|
2
|
+
|
3
|
+
name: Lint, Format, and MyPy
|
4
|
+
|
5
|
+
on:
|
6
|
+
push:
|
7
|
+
branches:
|
8
|
+
- "main-disabled"
|
9
|
+
paths:
|
10
|
+
- '**.py'
|
11
|
+
- 'pyproject.toml'
|
12
|
+
- 'requirements*.txt'
|
13
|
+
- 'tox.ini'
|
14
|
+
- 'scripts/*.sh'
|
15
|
+
- '.github/**'
|
16
|
+
pull_request:
|
17
|
+
branches:
|
18
|
+
- "main-disabled"
|
19
|
+
paths:
|
20
|
+
- '**.py'
|
21
|
+
- 'pyproject.toml'
|
22
|
+
- 'requirements*.txt'
|
23
|
+
- 'tox.ini'
|
24
|
+
- 'scripts/*.sh'
|
25
|
+
- '.github/**'
|
26
|
+
|
27
|
+
env:
|
28
|
+
PYTHON_VERSION: 3.11
|
29
|
+
|
30
|
+
jobs:
|
31
|
+
lint:
|
32
|
+
runs-on: ubuntu-latest
|
33
|
+
steps:
|
34
|
+
- name: Checkout
|
35
|
+
uses: actions/checkout@v4
|
36
|
+
with:
|
37
|
+
# https://github.com/actions/checkout/issues/249
|
38
|
+
fetch-depth: 0
|
39
|
+
submodules: true
|
40
|
+
|
41
|
+
- name: Setup Python 3.11
|
42
|
+
uses: actions/setup-python@v5
|
43
|
+
with:
|
44
|
+
python-version: 3.11
|
45
|
+
cache: pip
|
46
|
+
cache-dependency-path: |
|
47
|
+
**/pyproject.toml
|
48
|
+
**/requirements*.txt
|
49
|
+
|
50
|
+
- name: Install dependencies
|
51
|
+
id: deps
|
52
|
+
run: |
|
53
|
+
python -m pip install --upgrade pip
|
54
|
+
python -m pip install tox
|
55
|
+
|
56
|
+
- name: Run Ruff check
|
57
|
+
run: |
|
58
|
+
tox -e ruff -- check
|
59
|
+
|
60
|
+
- name: Run linting
|
61
|
+
if: ${{ !cancelled() && (steps.deps.outcome == 'success') }}
|
62
|
+
run: |
|
63
|
+
echo "::add-matcher::.github/workflows/matchers/pylint.json"
|
64
|
+
tox -e lint
|
65
|
+
|
66
|
+
- name: Run mypy type checks
|
67
|
+
if: ${{ !cancelled() && (steps.deps.outcome == 'success') }}
|
68
|
+
run: |
|
69
|
+
tox -e mypy
|
@@ -0,0 +1,18 @@
|
|
1
|
+
{
|
2
|
+
"problemMatcher": [
|
3
|
+
{
|
4
|
+
"owner": "actionlint",
|
5
|
+
"pattern": [
|
6
|
+
{
|
7
|
+
"regexp": "^(?:\\x1b\\[\\d+m)?(.+?)(?:\\x1b\\[\\d+m)*:(?:\\x1b\\[\\d+m)*(\\d+)(?:\\x1b\\[\\d+m)*:(?:\\x1b\\[\\d+m)*(\\d+)(?:\\x1b\\[\\d+m)*: (?:\\x1b\\[\\d+m)*(.+?)(?:\\x1b\\[\\d+m)* \\[(.+?)\\]$",
|
8
|
+
"file": 1,
|
9
|
+
"line": 2,
|
10
|
+
"column": 3,
|
11
|
+
"message": 4,
|
12
|
+
"code": 5
|
13
|
+
}
|
14
|
+
]
|
15
|
+
}
|
16
|
+
]
|
17
|
+
}
|
18
|
+
|
@@ -0,0 +1,33 @@
|
|
1
|
+
{
|
2
|
+
"problemMatcher": [
|
3
|
+
{
|
4
|
+
"owner": "pylint-error",
|
5
|
+
"severity": "error",
|
6
|
+
"pattern": [
|
7
|
+
{
|
8
|
+
"regexp": "^(.+):(\\d+):(\\d+):\\s(([EF]\\d{4}):\\s.+)$",
|
9
|
+
"file": 1,
|
10
|
+
"line": 2,
|
11
|
+
"column": 3,
|
12
|
+
"message": 4,
|
13
|
+
"code": 5
|
14
|
+
}
|
15
|
+
]
|
16
|
+
},
|
17
|
+
{
|
18
|
+
"owner": "pylint-warning",
|
19
|
+
"severity": "warning",
|
20
|
+
"pattern": [
|
21
|
+
{
|
22
|
+
"regexp": "^(.+):(\\d+):(\\d+):\\s(([CRW]\\d{4}):\\s.+)$",
|
23
|
+
"file": 1,
|
24
|
+
"line": 2,
|
25
|
+
"column": 3,
|
26
|
+
"message": 4,
|
27
|
+
"code": 5
|
28
|
+
}
|
29
|
+
]
|
30
|
+
}
|
31
|
+
]
|
32
|
+
}
|
33
|
+
|
@@ -0,0 +1,133 @@
|
|
1
|
+
# SPDX-License-Identifier: Apache-2.0
|
2
|
+
|
3
|
+
name: Build, test, and upload PyPI package
|
4
|
+
|
5
|
+
on:
|
6
|
+
push:
|
7
|
+
branches:
|
8
|
+
- "main"
|
9
|
+
- "release-**"
|
10
|
+
tags:
|
11
|
+
- "v*"
|
12
|
+
pull_request:
|
13
|
+
branches:
|
14
|
+
- "main"
|
15
|
+
- "release-**"
|
16
|
+
release:
|
17
|
+
types:
|
18
|
+
- published
|
19
|
+
|
20
|
+
env:
|
21
|
+
LC_ALL: en_US.UTF-8
|
22
|
+
|
23
|
+
defaults:
|
24
|
+
run:
|
25
|
+
shell: bash
|
26
|
+
|
27
|
+
permissions:
|
28
|
+
contents: read
|
29
|
+
|
30
|
+
jobs:
|
31
|
+
# Create and verify release artifacts
|
32
|
+
# - build source dist (tar ball) and wheel
|
33
|
+
# - validate artifacts with various tools
|
34
|
+
# - upload artifacts to GHA
|
35
|
+
build-package:
|
36
|
+
name: Build and check packages
|
37
|
+
runs-on: ubuntu-latest
|
38
|
+
steps:
|
39
|
+
- name: "Harden Runner"
|
40
|
+
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
|
41
|
+
with:
|
42
|
+
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
|
43
|
+
|
44
|
+
|
45
|
+
- name: "Checkout"
|
46
|
+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
47
|
+
with:
|
48
|
+
# for setuptools-scm
|
49
|
+
fetch-depth: 0
|
50
|
+
|
51
|
+
- name: "Build and Inspect"
|
52
|
+
uses: hynek/build-and-inspect-python-package@b5076c307dc91924a82ad150cdd1533b444d3310 # v2.12.0
|
53
|
+
|
54
|
+
# push to Test PyPI on
|
55
|
+
# - a new GitHub release is published
|
56
|
+
# - a PR is merged into main branch
|
57
|
+
publish-test-pypi:
|
58
|
+
name: Publish packages to test.pypi.org
|
59
|
+
# environment: publish-test-pypi
|
60
|
+
if: ${{ (github.repository_owner == 'Red-Hat-AI-Innovation-Team') && ((github.event.action == 'published') || ((github.event_name == 'push') && (github.ref == 'refs/heads/main'))) }}
|
61
|
+
permissions:
|
62
|
+
contents: read
|
63
|
+
# see https://docs.pypi.org/trusted-publishers/
|
64
|
+
id-token: write
|
65
|
+
runs-on: ubuntu-latest
|
66
|
+
needs: build-package
|
67
|
+
|
68
|
+
steps:
|
69
|
+
- name: "Harden Runner"
|
70
|
+
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
|
71
|
+
with:
|
72
|
+
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
|
73
|
+
|
74
|
+
- name: "Download build artifacts"
|
75
|
+
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
|
76
|
+
with:
|
77
|
+
name: Packages
|
78
|
+
path: dist
|
79
|
+
|
80
|
+
- name: "Upload to Test PyPI"
|
81
|
+
uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4
|
82
|
+
with:
|
83
|
+
repository-url: https://test.pypi.org/legacy/
|
84
|
+
|
85
|
+
# push to Production PyPI on
|
86
|
+
# - a new GitHub release is published
|
87
|
+
publish-pypi:
|
88
|
+
name: Publish release to pypi.org
|
89
|
+
# environment: publish-pypi
|
90
|
+
if: ${{ (github.repository_owner == 'Red-Hat-AI-Innovation-Team') && (github.event.action == 'published') }}
|
91
|
+
permissions:
|
92
|
+
# see https://docs.pypi.org/trusted-publishers/
|
93
|
+
id-token: write
|
94
|
+
# allow gh release upload
|
95
|
+
contents: write
|
96
|
+
|
97
|
+
runs-on: ubuntu-latest
|
98
|
+
needs: build-package
|
99
|
+
|
100
|
+
steps:
|
101
|
+
- name: "Harden Runner"
|
102
|
+
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
|
103
|
+
with:
|
104
|
+
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
|
105
|
+
|
106
|
+
- name: "Download build artifacts"
|
107
|
+
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
|
108
|
+
with:
|
109
|
+
name: Packages
|
110
|
+
path: dist
|
111
|
+
|
112
|
+
- name: "Sigstore sign package"
|
113
|
+
uses: sigstore/gh-action-sigstore-python@f514d46b907ebcd5bedc05145c03b69c1edd8b46 # v3.0.0
|
114
|
+
with:
|
115
|
+
inputs: |
|
116
|
+
./dist/*.tar.gz
|
117
|
+
./dist/*.whl
|
118
|
+
release-signing-artifacts: false
|
119
|
+
|
120
|
+
- name: "Upload artifacts and signatures to GitHub release"
|
121
|
+
run: |
|
122
|
+
gh release upload '${{ github.ref_name }}' dist/* --repo '${{ github.repository }}'
|
123
|
+
env:
|
124
|
+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
125
|
+
|
126
|
+
# PyPI does not accept .sigstore artifacts and
|
127
|
+
# gh-action-pypi-publish has no option to ignore them.
|
128
|
+
- name: "Remove sigstore signatures before uploading to PyPI"
|
129
|
+
run: |
|
130
|
+
rm ./dist/*.sigstore.json
|
131
|
+
|
132
|
+
- name: "Upload to PyPI"
|
133
|
+
uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4
|