Skip to content
Merged
Show file tree
Hide file tree
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
34 changes: 34 additions & 0 deletions .github/actions/setup-env-vars/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: "Setup Env Vars"

runs:
using: "composite"
steps:
- name: Get Commit SHA(For push)
if: ${{ github.event_name == 'push' }}
shell: bash
env:
SHA: ${{ github.sha }}
branch: ${{ github.ref }}
git_repo: ${{ github.repository }}
pr_number: ""
run: |

short_sha=$(git rev-parse --short "$SHA")
echo "BRANCH=$branch" >> $GITHUB_ENV
echo "GIT_REPO=$git_repo" >> $GITHUB_ENV
echo "SHORT_SHA=$short_sha" >> $GITHUB_ENV
echo "PR_NUMBER=$pr_number" >> $GITHUB_ENV
- name: Get Commit SHA(For pull request)
if: ${{ github.event_name == 'pull_request_target' }}
shell: bash
env:
SHA: ${{ github.event.pull_request.head.sha }}
branch: ${{ github.event.pull_request.head.ref }}
git_repo: ${{ github.event.pull_request.head.repo.full_name }}
pr_number: PR-${{ github.event.number }}
run: |
short_sha=$(git rev-parse --short "$SHA")
echo "BRANCH=$branch" >> $GITHUB_ENV
echo "GIT_REPO=$git_repo" >> $GITHUB_ENV
echo "SHORT_SHA=$short_sha" >> $GITHUB_ENV
echo "PR_NUMBER=$pr_number" >> $GITHUB_ENV
63 changes: 63 additions & 0 deletions .github/workflow_scripts/build_doc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
#!/bin/bash

BRANCH=$(basename $1)
GIT_REPO=$2
COMMIT_SHA=$3
PR_NUMBER=$4

set -ex

source $(dirname "$0")/env_setup.sh

if [[ (-n $PR_NUMBER) || ($GIT_REPO != "autogluon/autogluon-assistant") ]]
then
# Put in rag bucket for staging purpose (reusing the existing bucket as specified)
BUCKET='autogluon-assistant-doc-staging'
if [[ -n $PR_NUMBER ]]; then path=$PR_NUMBER/$COMMIT_SHA; else path=$BRANCH/$COMMIT_SHA; fi
site=d1at46xkvcde0c.cloudfront.net/$path
flags='--delete'
cacheControl=''
else
if [[ $BRANCH == "main" ]]
then
path="assistant/dev"
else
if [[ $BRANCH == "dev" ]]
then
path="assistant/dev-branch"
else
path="assistant/$BRANCH"
fi
fi
BUCKET='autogluon.mxnet.io'
site=$BUCKET/$path # site is the actual bucket location that will serve the doc
if [[ $BRANCH == 'main' ]]; then flags=''; else flags='--delete'; fi
cacheControl='--cache-control max-age=7200'
fi

other_doc_version_text='Stable Version Documentation'
other_doc_version_branch='stable'
if [[ $BRANCH == 'stable' ]]
then
other_doc_version_text='Dev Version Documentation'
other_doc_version_branch='dev'
fi

setup_build_contrib_env

install_assistant
cd docs && sphinx-build -b html . _build/html

COMMAND_EXIT_CODE=$?
if [[ $COMMAND_EXIT_CODE -ne 0 ]]; then
exit COMMAND_EXIT_CODE
fi

DOC_PATH=_build/html/

if [[ (-n $PR_NUMBER) || ($GIT_REPO != "autogluon/autogluon-assistant") ]]
then
aws s3 sync ${flags} ${DOC_PATH} s3://${BUCKET}/${path} ${cacheControl}
else
aws s3 sync ${flags} ${DOC_PATH} s3://${BUCKET}/${path} --acl public-read ${cacheControl}
fi
22 changes: 21 additions & 1 deletion .github/workflow_scripts/env_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,24 @@ function install_coverage_test {
python3 -m pip install pytest
python3 -m pip install pytest-cov
python3 -m pip install coverage-threshold
}
}

# Documentation-specific functions
function setup_build_contrib_env {
python3 -m pip install --upgrade pip
# Find the docs directory relative to the script location
SCRIPT_DIR=$(dirname "$0")
if [ -f "$SCRIPT_DIR/../../docs/requirements_doc.txt" ]; then
python3 -m pip install -r "$SCRIPT_DIR/../../docs/requirements_doc.txt"
elif [ -f "docs/requirements_doc.txt" ]; then
python3 -m pip install -r docs/requirements_doc.txt
else
echo "Warning: Could not find docs/requirements_doc.txt"
fi
python3 -m pip install awscli
export AG_DOCS=1
}

function install_assistant {
python3 -m pip install --upgrade -e .
}
47 changes: 47 additions & 0 deletions .github/workflows/continuous_integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ permissions:
id-token: write
contents: read
pull-requests: write # for removing tags
issues: write # for peter-evans/create-or-update-comment on the PR

concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.event.pull_request.head.sha }}
Expand Down Expand Up @@ -105,3 +106,49 @@ jobs:
with:
aws-role-arn: ${{ secrets.AWS_CI_ROLE_ARN }}
submodule-to-test: integration

build_doc:
if: ${{ github.event_name != 'schedule' }}
needs: [integration_test]
runs-on: ubuntu-latest
steps:
- name: Checkout repository
if: ${{ github.event_name != 'pull_request_target' }}
uses: actions/checkout@v4
- name: Checkout repository(Pull Request Target)
if: ${{ github.event_name == 'pull_request_target' }}
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Setup Env Vars
uses: ./.github/actions/setup-env-vars
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- uses: r-lib/actions/setup-pandoc@v2
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::369469875935:role/AutoGluonRAGCIDocRole
role-duration-seconds: 3600
aws-region: us-east-1
- name: Build Doc(For push)
if: ${{ github.event_name == 'push' }}
run: |
chmod +x ./.github/workflow_scripts/build_doc.sh
./.github/workflow_scripts/build_doc.sh '${{ github.ref }}' '${{ github.repository }}' '${{ env.SHORT_SHA }}'
- name: Build Doc(For pull request)
if: ${{ github.event_name == 'pull_request_target' }}
env:
branch: ${{ github.event.pull_request.head.ref }}
run: |
chmod +x ./.github/workflow_scripts/build_doc.sh
./.github/workflow_scripts/build_doc.sh "$branch" '${{ github.event.pull_request.head.repo.full_name }}' '${{ env.SHORT_SHA }}' PR-'${{ github.event.number }}'
- name: Comment on PR
if: ${{ github.event_name == 'pull_request_target' }}
uses: peter-evans/create-or-update-comment@v4
with:
issue-number: ${{ github.event.number }}
body: |
Job PR-${{ github.event.number }}-${{ env.SHORT_SHA }} is done.
Docs are uploaded to https://d1at46xkvcde0c.cloudfront.net/PR-${{ github.event.number }}/${{ env.SHORT_SHA }}/index.html
1 change: 1 addition & 0 deletions .github/workflows/test_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ jobs:
- name: Install build dependencies
run: |
python -m pip install --upgrade pip

pip install build wheel

- name: Build package
Expand Down
1 change: 1 addition & 0 deletions NOTICE
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
ML Assistant for Competitive Machine Learning

Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved.
47 changes: 47 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# AutoGluon-Assistant Documentation

This directory contains the documentation for AutoGluon-Assistant.

## Building the Documentation

To build the documentation locally:

1. Install the documentation requirements:
```bash
pip install -r requirements_doc.txt
```

2. Install AutoGluon-Assistant in development mode:
```bash
pip install -e ..
```

3. Build the documentation:
```bash
sphinx-build -b html . _build/html
```

4. Open the documentation in your browser:
```bash
open _build/html/index.html
```

## Documentation Structure

- `index.md` - Main landing page
- `api/` - API reference documentation
- `tutorials/` - Step-by-step tutorials
- `whats_new/` - Release notes and changelog
- `_static/` - Static assets (images, CSS, JS)
- `_templates/` - Sphinx templates
- `conf.py` - Sphinx configuration

## Contributing

When adding new documentation:

1. Follow the existing structure and style
2. Use MyST Markdown format for content
3. Add new pages to the appropriate toctree
4. Test the build locally before submitting
5. Update the API documentation if adding new modules
Binary file added docs/_static/autogluon-s.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_static/autogluon-w.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_static/autogluon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
47 changes: 47 additions & 0 deletions docs/_static/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
.highlight-bash .highlight {
border: 1px #ccc solid;
}

div.cell div.cell_input, .highlight-bash .highlight {
border-left-color: var(--color-brand-content);
border-left-width: medium;
border-radius: 0.2rem;
}

div.cell_output table {
color: #2b8cee;
font-size: 0.8rem;
}

div.cell_output {
overflow-x: scroll;
margin-top: 0;
}

div.sidebar-scroll {
scroll-behavior: auto;
}

.dataframe {
margin: 1em 0;
}

details.toggle-details summary:hover, details.toggle-details summary:active, details.toggle-details summary {
background: transparent;
}


details.sd-dropdown summary {
padding: .5rem;
}

details.sd-dropdown .sd-summary-up, details.sd-dropdown .sd-summary-down {
top: .5rem;
}

body[data-theme="dark"] {
--mystnb-source-bg-color: #202020;
--mystnb-stdout-bg-color: #202020;
--mystnb-stderr-bg-color: #ee0000;
--mystnb-traceback-bg-color: #202020;
}
10 changes: 10 additions & 0 deletions docs/_static/custom.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
let sidebar_scroll_element = document.querySelector(".sidebar-scroll");

let saved_top = sessionStorage.getItem("sidebar-scroll-top");
if (saved_top !== null) {
sidebar_scroll_element.scrollTop = parseInt(saved_top, 10);
}

window.addEventListener("beforeunload", () => {
sessionStorage.setItem("sidebar-scroll-top", sidebar_scroll_element.scrollTop);
});
Binary file added docs/_static/favicon.ico
Binary file not shown.
5 changes: 5 additions & 0 deletions docs/_templates/autosummary/base.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{{ objname | escape | underline}}

.. currentmodule:: {{ module }}

.. auto{{ objtype }}:: {{ objname }}
31 changes: 31 additions & 0 deletions docs/_templates/autosummary/class.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{{ objname | escape | underline}}

.. currentmodule:: {{ module }}

.. autoclass:: {{ objname }}
:members:

{% block methods %}

{% if methods %}
.. rubric:: {{ _('Methods') }}

.. autosummary::
:nosignatures:

{% for item in methods if item != '__init__' %}
~{{ name }}.{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}

{% block attributes %}
{% if attributes %}
.. rubric:: {{ _('Attributes') }}

.. autosummary::
{% for item in attributes %}
~{{ name }}.{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}
Loading
Loading