From a931e94e0c83ffc3da789f58a0c784f9e43f1329 Mon Sep 17 00:00:00 2001 From: Christopher Rabotin Date: Sat, 10 Jun 2023 17:00:30 -0600 Subject: [PATCH 01/15] Trying to add a docker pkg for nyx python --- .github/workflows/python.yml | 17 +++++++++++++++- Dockerfile | 38 ++++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 Dockerfile diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index b442b623..bd090676 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -28,6 +28,7 @@ jobs: - uses: actions/setup-python@v4 with: python-version: "3.10" + - name: Build wheels uses: PyO3/maturin-action@v1 with: @@ -35,11 +36,13 @@ jobs: args: --release --out dist --find-interpreter -F python sccache: 'true' manylinux: auto + - name: Upload wheels uses: actions/upload-artifact@v3 with: name: wheels path: dist + - name: pytest x86_64 if: ${{ matrix.target == 'x86_64' }} shell: bash @@ -48,6 +51,7 @@ jobs: pip install nyx_space --find-links dist --force-reinstall pip install pytest numpy pandas plotly pyarrow scipy pytest + - name: pytest if: ${{ !startsWith(matrix.target, 'x86') && matrix.target != 'ppc64' && matrix.target != 'aarch64' }} uses: uraimo/run-on-arch-action@v2.5.0 @@ -63,12 +67,23 @@ jobs: set -e pip3 install nyx_space --find-links dist --force-reinstall pytest + - name: Upload python tests HTMLs uses: actions/upload-artifact@v3 with: name: od-plots path: output_data/*.html + - name: Build and push Docker image + if: startsWith(matrix.target, 'x86_64') && (startsWith(github.ref, 'refs/tags/') || (startsWith(matrix.target, 'x86_64') && github.ref == 'refs/heads/master')) + uses: docker/build-push-action@v2 + with: + context: . + file: ./docker/Dockerfile.pkg + push: true + tags: ghcr.io/nyx-space/nyx:${{ startsWith(github.ref, 'refs/tags/') && substr(github.ref, 10) || 'latest' }} + + windows: runs-on: windows-latest strategy: @@ -148,7 +163,7 @@ jobs: release: name: Release runs-on: ubuntu-latest - if: "startsWith(github.ref, 'refs/tags/')" + if: ${{ startsWith(github.ref, 'refs/tags/') }} needs: [linux, windows, macos, sdist] steps: - uses: actions/download-artifact@v3 diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..59ec68e1 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,38 @@ +# Dockerfile +FROM python:3.10 + +WORKDIR /app + +# Create a non-root user +RUN useradd -ms /bin/bash nyx-user + +# Copy over the wheel files +# COPY dist/*.whl /app +COPY target/wheels/*.whl /app + +# Install the Python wheel +RUN pip install /app/*.whl + +# Install workflow and pipeline features +RUN pip install kedro kedro-viz ruff jupyter + +# Install zsh +RUN apt-get update && apt-get install -y zsh + +# Switch to the new user +USER nyx-user + +# Install oh-my-zsh +RUN sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" + +# Set the zsh theme +RUN sed -i 's/ZSH_THEME="robbyrussell"/ZSH_THEME="fino-time"/' ~/.zshrc + +# Change default shell to zsh +SHELL ["/bin/zsh", "-c"] + +RUN mkdir -p $HOME/workspace + +WORKDIR /home/nyx-user/workspace + +CMD ["zsh"] From 3a4c6a5d065ac5d59ff10c0d7ef4c50a84e38ba9 Mon Sep 17 00:00:00 2001 From: Christopher Rabotin Date: Sat, 10 Jun 2023 17:36:53 -0600 Subject: [PATCH 02/15] Dev container somewhat works --- .github/workflows/python.yml | 14 ++++++++++---- Dockerfile | 12 +++++++----- Dockerfile.dev | 36 ++++++++++++++++++++++++++++++++++++ 3 files changed, 53 insertions(+), 9 deletions(-) create mode 100644 Dockerfile.dev diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index bd090676..620de585 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -74,15 +74,21 @@ jobs: name: od-plots path: output_data/*.html + - name: Get short SHA + id: short-sha + run: echo "::set-output name=sha::$(echo ${GITHUB_SHA::8})" + - name: Build and push Docker image - if: startsWith(matrix.target, 'x86_64') && (startsWith(github.ref, 'refs/tags/') || (startsWith(matrix.target, 'x86_64') && github.ref == 'refs/heads/master')) + if: startsWith(matrix.target, 'x86_64') uses: docker/build-push-action@v2 with: context: . - file: ./docker/Dockerfile.pkg + file: ./Dockerfile push: true - tags: ghcr.io/nyx-space/nyx:${{ startsWith(github.ref, 'refs/tags/') && substr(github.ref, 10) || 'latest' }} - + tags: | + ghcr.io/nyx-space/nyx:${{ steps.short-sha.outputs.sha }} + ghcr.io/nyx-space/nyx:${{ github.ref == 'refs/heads/master' && 'latest' || steps.short-sha.outputs.sha }} + ghcr.io/nyx-space/nyx:${{ startsWith(github.ref, 'refs/tags/') && substr(github.ref, 10) || steps.short-sha.outputs.sha }} windows: runs-on: windows-latest diff --git a/Dockerfile b/Dockerfile index 59ec68e1..06c0f9ad 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,10 @@ -# Dockerfile -FROM python:3.10 +# Start with OpenSUSE Tumbleweed +FROM opensuse/tumbleweed + +# Install Python 3.10 and other necessary packages +RUN zypper ref && \ + zypper -n in python310 python310-pip zsh uuid-runtime shadow git git-lfs && \ + zypper clean WORKDIR /app @@ -16,9 +21,6 @@ RUN pip install /app/*.whl # Install workflow and pipeline features RUN pip install kedro kedro-viz ruff jupyter -# Install zsh -RUN apt-get update && apt-get install -y zsh - # Switch to the new user USER nyx-user diff --git a/Dockerfile.dev b/Dockerfile.dev new file mode 100644 index 00000000..b20a5c04 --- /dev/null +++ b/Dockerfile.dev @@ -0,0 +1,36 @@ +# This is a container for development of Nyx +# Start with OpenSUSE Tumbleweed +FROM opensuse/tumbleweed + +# Install Python 3.10 and other necessary packages +RUN zypper ref && \ + zypper -n in gcc make python310 python310-pip zsh uuid-runtime shadow git git-lfs && \ + zypper clean + +# Create a non-root user +RUN useradd -ms /bin/bash nyx-dev + +# Switch to the new user +USER nyx-dev + +WORKDIR /home/nyx-dev + +# Install Rust for this user +RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs -o rustup.sh && sh rustup.sh -y + +# Install oh-my-zsh +RUN sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" + +# Set the zsh theme +RUN sed -i 's/ZSH_THEME="robbyrussell"/ZSH_THEME="fino-time"/' ~/.zshrc + +# Change default shell to zsh +SHELL ["/bin/zsh", "-c"] + +RUN source "$HOME/.cargo/env" + +RUN mkdir -p $HOME/workspace + +WORKDIR /home/nyx-dev/workspace + +CMD ["zsh"] From cf48fa8553348a4d12f39d49e5dfd4e3fd070e06 Mon Sep 17 00:00:00 2001 From: Christopher Rabotin Date: Sat, 10 Jun 2023 17:39:43 -0600 Subject: [PATCH 03/15] Trying to build the package in its own container --- .github/workflows/python.yml | 59 ++++++++++++++++++++++++++---------- 1 file changed, 43 insertions(+), 16 deletions(-) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 620de585..fdc03a8d 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -74,22 +74,6 @@ jobs: name: od-plots path: output_data/*.html - - name: Get short SHA - id: short-sha - run: echo "::set-output name=sha::$(echo ${GITHUB_SHA::8})" - - - name: Build and push Docker image - if: startsWith(matrix.target, 'x86_64') - uses: docker/build-push-action@v2 - with: - context: . - file: ./Dockerfile - push: true - tags: | - ghcr.io/nyx-space/nyx:${{ steps.short-sha.outputs.sha }} - ghcr.io/nyx-space/nyx:${{ github.ref == 'refs/heads/master' && 'latest' || steps.short-sha.outputs.sha }} - ghcr.io/nyx-space/nyx:${{ startsWith(github.ref, 'refs/tags/') && substr(github.ref, 10) || steps.short-sha.outputs.sha }} - windows: runs-on: windows-latest strategy: @@ -182,3 +166,46 @@ jobs: with: command: upload args: --skip-existing * + + packaging: + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Build development image + run: docker build -f Dockerfile.dev -t nyx-build . + + - name: Run development container and build the package + run: docker run --name nyx-builder nyx-build + + - name: Copy built package from container to host + run: docker cp nyx-builder:/app/dist ./dist + + - name: Get short SHA + id: short-sha + run: echo "::set-output name=sha::$(echo ${GITHUB_SHA::8})" + + - name: Build and push Docker image with built package + uses: docker/build-push-action@v2 + with: + context: . + file: ./Dockerfile.pkg + push: true + tags: | + ghcr.io/nyx-space/nyx:${{ steps.short-sha.outputs.sha }} + ghcr.io/nyx-space/nyx:${{ github.ref == 'refs/heads/master' && 'latest' || steps.short-sha.outputs.sha }} + ghcr.io/nyx-space/nyx:${{ startsWith(github.ref, 'refs/tags/') && substr(github.ref, 10) || steps.short-sha.outputs.sha }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache \ No newline at end of file From 4ee58d4d5d23232ff4a288b1ed219c3e1f25b638 Mon Sep 17 00:00:00 2001 From: Christopher Rabotin Date: Sat, 10 Jun 2023 17:43:56 -0600 Subject: [PATCH 04/15] Substr is not OK Bad GPT. --- .github/workflows/python.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index fdc03a8d..361bf804 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -197,6 +197,10 @@ jobs: id: short-sha run: echo "::set-output name=sha::$(echo ${GITHUB_SHA::8})" + - name: Get the version + id: get_version + run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/} + - name: Build and push Docker image with built package uses: docker/build-push-action@v2 with: @@ -206,6 +210,6 @@ jobs: tags: | ghcr.io/nyx-space/nyx:${{ steps.short-sha.outputs.sha }} ghcr.io/nyx-space/nyx:${{ github.ref == 'refs/heads/master' && 'latest' || steps.short-sha.outputs.sha }} - ghcr.io/nyx-space/nyx:${{ startsWith(github.ref, 'refs/tags/') && substr(github.ref, 10) || steps.short-sha.outputs.sha }} + ghcr.io/nyx-space/nyx:${{ startsWith(github.ref, 'refs/tags/') && steps.get_version.outputs.VERSION || steps.short-sha.outputs.sha }} cache-from: type=local,src=/tmp/.buildx-cache cache-to: type=local,dest=/tmp/.buildx-cache \ No newline at end of file From cc64260c429004c595ddbdeadcfccc5f96819896 Mon Sep 17 00:00:00 2001 From: Christopher Rabotin Date: Sat, 10 Jun 2023 18:39:45 -0600 Subject: [PATCH 05/15] Fix dockerfile for build --- .github/workflows/python.yml | 6 +- .gitignore | 3 +- .gitlab-ci.yml | 122 ----------------------------------- Dockerfile | 3 +- Dockerfile.dev | 36 ++++------- 5 files changed, 19 insertions(+), 151 deletions(-) delete mode 100644 .gitlab-ci.yml diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 361bf804..2ed76b68 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -188,10 +188,10 @@ jobs: run: docker build -f Dockerfile.dev -t nyx-build . - name: Run development container and build the package - run: docker run --name nyx-builder nyx-build + run: docker run --name nyx-builder nyx-build maturin build -F python --release - name: Copy built package from container to host - run: docker cp nyx-builder:/app/dist ./dist + run: docker cp nyx-builder:/app/target/wheels ./dist - name: Get short SHA id: short-sha @@ -205,7 +205,7 @@ jobs: uses: docker/build-push-action@v2 with: context: . - file: ./Dockerfile.pkg + file: ./Dockerfile push: true tags: | ghcr.io/nyx-space/nyx:${{ steps.short-sha.outputs.sha }} diff --git a/.gitignore b/.gitignore index 316f9f01..c68d905e 100644 --- a/.gitignore +++ b/.gitignore @@ -14,4 +14,5 @@ node_modules/ dist/ *.parquet *.profraw -lcov.txt \ No newline at end of file +lcov.txt + diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index bbbd895a..00000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,122 +0,0 @@ -stages: - - build - - test - - quality - - deploy - -cache: - paths: - - .cargo - - target - -variables: - CARGO_HOME: ${CI_PROJECT_DIR}/.cargo - -compile: - stage: build - image: rust:1-bullseye - script: - - cargo build --tests --release # Build all of the tests in release mode - - cargo build --release # Build the binaries - -unit-tests: - stage: test - image: rust:1-bullseye - variables: - RUST_BACKTRACE: 1 - script: - - cargo test --lib --release # Unit tests - -mission-design-integration-tests: - stage: test - image: rust:1-bullseye - variables: - RUST_BACKTRACE: 1 - script: - - cargo test cosmic --release - - cargo test mission_design --release - - cargo test monte_carlo --release - -propulsion-integration-tests: - stage: test - image: rust:1-bullseye - variables: - RUST_BACKTRACE: 1 - script: - - cargo test closedloop_single --release - - cargo test closedloop_multi --release - - cargo test schedule --release - -propagation-integration-tests: - stage: test - image: rust:1-bullseye - variables: - RUST_BACKTRACE: 1 - script: - - cargo test stopcond --release - - cargo test stm --release - - cargo test events --release - - cargo test targeter --release - - cargo test trajectory --release - -orbit-determination-integration-tests: - stage: test - image: rust:1-bullseye - variables: - RUST_BACKTRACE: 1 - script: - - cargo test orbit_determination --release - allow_failure: true - -scenario-tests: - image: rust:1-bullseye - script: - - cargo run --release -- data/simple-scenario.toml --all - # Check that when we do a unit conversion it's correct - # NOTE: We don't do that with km output because the unit conversion leads to some rounding issues - - diff ./data/scenario-run-cm.csv ./data/scenario-run-m.csv - - cargo run --release -- data/simple-od-scenario.toml - - cargo run --release -- "data/od_validation/*" -a - - cargo run --release -- data/iss-example.toml -s iss_cond - -pages: - stage: deploy - image: rust:1-bullseye - variables: - CARGO_HOME: $CI_PROJECT_DIR/cargo - cache: - paths: - - target/ - - cargo/ - before_script: - - rustup component add rustfmt - script: - - mkdir -p public - - cargo doc --verbose --no-deps --release - - cp -R target/doc/* ./public/ - - cp docs/index.html ./public/ - artifacts: - paths: - - public - rules: - - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH - when: always - - if: $CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH - when: never - -fmt_and_lint: - stage: quality - image: rust:1-bullseye - script: - - rustup component add rustfmt - - cargo fmt -- --check - - rustup component add clippy - - cargo clippy - -audit: - stage: quality - image: rust:1-bullseye - script: - - cargo install cargo-audit - - cargo audit - allow_failure: true diff --git a/Dockerfile b/Dockerfile index 06c0f9ad..518414b3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,8 +12,7 @@ WORKDIR /app RUN useradd -ms /bin/bash nyx-user # Copy over the wheel files -# COPY dist/*.whl /app -COPY target/wheels/*.whl /app +COPY dist/*.whl /app # Install the Python wheel RUN pip install /app/*.whl diff --git a/Dockerfile.dev b/Dockerfile.dev index b20a5c04..08d662d3 100644 --- a/Dockerfile.dev +++ b/Dockerfile.dev @@ -1,36 +1,26 @@ -# This is a container for development of Nyx +# This is a container to build the Nyx Python package on OpenSUSE # Start with OpenSUSE Tumbleweed FROM opensuse/tumbleweed # Install Python 3.10 and other necessary packages RUN zypper ref && \ - zypper -n in gcc make python310 python310-pip zsh uuid-runtime shadow git git-lfs && \ + zypper -n in gcc make python310 python310-pip uuid-runtime perl && \ zypper clean -# Create a non-root user -RUN useradd -ms /bin/bash nyx-dev +WORKDIR /app -# Switch to the new user -USER nyx-dev - -WORKDIR /home/nyx-dev - -# Install Rust for this user +# Install Rust RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs -o rustup.sh && sh rustup.sh -y -# Install oh-my-zsh -RUN sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" - -# Set the zsh theme -RUN sed -i 's/ZSH_THEME="robbyrussell"/ZSH_THEME="fino-time"/' ~/.zshrc - -# Change default shell to zsh -SHELL ["/bin/zsh", "-c"] - -RUN source "$HOME/.cargo/env" +# Make Rust available +ENV PATH="${PATH}:/root/.cargo/bin" +ENV RUST_BACKTRACE=full -RUN mkdir -p $HOME/workspace +# Install maturin to build the package +RUN pip install maturin -WORKDIR /home/nyx-dev/workspace +# Finally copy +COPY . /app -CMD ["zsh"] +# And build in release only +CMD ["maturin", "build", "-F", "python", "--release"] From 0903428a143fc95a5117d35511f30d5252e2fbec Mon Sep 17 00:00:00 2001 From: Christopher Rabotin Date: Sat, 10 Jun 2023 18:52:02 -0600 Subject: [PATCH 06/15] Add dockerignore --- .dockerignore | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..a7dfd547 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,22 @@ +target +output_data +docs +.git +.venv +*.parquet +**/*.rs.bk +Cargo.lock +tests/Papers +node_modules/ +*.bsp +*.script.bak +**/*.csv +*.old +*.svg +*.data +*.folded +*.venv +dist/ +*.parquet +*.profraw +lcov.txt From 4c7ca52b9b1a06b372c0f4940c43659961df4695 Mon Sep 17 00:00:00 2001 From: Christopher Rabotin Date: Sat, 10 Jun 2023 19:17:46 -0600 Subject: [PATCH 07/15] Login to github registry --- .github/workflows/python.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 2ed76b68..10dc3f7c 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -201,6 +201,13 @@ jobs: id: get_version run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/} + - name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build and push Docker image with built package uses: docker/build-push-action@v2 with: From 071b0ecde61d9b051f2b81fbdc72656977f3b31b Mon Sep 17 00:00:00 2001 From: Christopher Rabotin Date: Sat, 10 Jun 2023 19:32:44 -0600 Subject: [PATCH 08/15] Add rustdoc deployment --- .firebaserc | 5 ++++ .github/workflows/firebase-hosting-merge.yml | 24 +++++++++++++++++++ .../firebase-hosting-pull-request.yml | 21 ++++++++++++++++ firebase.json | 11 +++++++++ 4 files changed, 61 insertions(+) create mode 100644 .firebaserc create mode 100644 .github/workflows/firebase-hosting-merge.yml create mode 100644 .github/workflows/firebase-hosting-pull-request.yml create mode 100644 firebase.json diff --git a/.firebaserc b/.firebaserc new file mode 100644 index 00000000..351cb5bb --- /dev/null +++ b/.firebaserc @@ -0,0 +1,5 @@ +{ + "projects": { + "default": "nyx-space" + } +} diff --git a/.github/workflows/firebase-hosting-merge.yml b/.github/workflows/firebase-hosting-merge.yml new file mode 100644 index 00000000..ee9401d0 --- /dev/null +++ b/.github/workflows/firebase-hosting-merge.yml @@ -0,0 +1,24 @@ +# This file was auto-generated by the Firebase CLI +# https://github.com/firebase/firebase-tools + +name: Deploy to Firebase Hosting on merge +'on': + push: + branches: + - master +jobs: + build_and_deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@master + with: + toolchain: stable + - run: cargo doc --no-deps + - uses: FirebaseExtended/action-hosting-deploy@v0 + with: + repoToken: '${{ secrets.GITHUB_TOKEN }}' + firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_NYX_SPACE }}' + channelId: live + projectId: nyx-space diff --git a/.github/workflows/firebase-hosting-pull-request.yml b/.github/workflows/firebase-hosting-pull-request.yml new file mode 100644 index 00000000..08990801 --- /dev/null +++ b/.github/workflows/firebase-hosting-pull-request.yml @@ -0,0 +1,21 @@ +# This file was auto-generated by the Firebase CLI +# https://github.com/firebase/firebase-tools + +name: Deploy to Firebase Hosting on PR +'on': pull_request +jobs: + build_and_preview: + if: '${{ github.event.pull_request.head.repo.full_name == github.repository }}' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@master + with: + toolchain: stable + - run: cargo doc --no-deps + - uses: FirebaseExtended/action-hosting-deploy@v0 + with: + repoToken: '${{ secrets.GITHUB_TOKEN }}' + firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_NYX_SPACE }}' + projectId: nyx-space diff --git a/firebase.json b/firebase.json new file mode 100644 index 00000000..76baec2c --- /dev/null +++ b/firebase.json @@ -0,0 +1,11 @@ +{ + "hosting": { + "site": "nyx-rustdoc", + "public": "target/doc/nyx_space", + "ignore": [ + "firebase.json", + "**/.*", + "**/node_modules/**" + ] + } +} From 28fd3df30dbb602bcfe2efec0f7d9af9753eaa0c Mon Sep 17 00:00:00 2001 From: Christopher Rabotin Date: Sat, 10 Jun 2023 19:39:30 -0600 Subject: [PATCH 09/15] Maybe I need the assets too? --- firebase.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firebase.json b/firebase.json index 76baec2c..42a4d4c3 100644 --- a/firebase.json +++ b/firebase.json @@ -1,7 +1,7 @@ { "hosting": { "site": "nyx-rustdoc", - "public": "target/doc/nyx_space", + "public": "target/doc", "ignore": [ "firebase.json", "**/.*", From 5f429fae68a90e89a05b5a93a9f35d0b74028265 Mon Sep 17 00:00:00 2001 From: Christopher Rabotin Date: Sat, 10 Jun 2023 20:12:52 -0600 Subject: [PATCH 10/15] Woop this should work now --- .dockerignore | 1 - .github/workflows/python.yml | 1 + Dockerfile | 22 +++++++++++++--------- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/.dockerignore b/.dockerignore index a7dfd547..eea7c028 100644 --- a/.dockerignore +++ b/.dockerignore @@ -16,7 +16,6 @@ node_modules/ *.data *.folded *.venv -dist/ *.parquet *.profraw lcov.txt diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 10dc3f7c..6db920ec 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -169,6 +169,7 @@ jobs: packaging: runs-on: ubuntu-latest + needs: [linux] # Don't package if the tests fail. steps: - name: Check out code uses: actions/checkout@v2 diff --git a/Dockerfile b/Dockerfile index 518414b3..41a048e8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,15 +11,6 @@ WORKDIR /app # Create a non-root user RUN useradd -ms /bin/bash nyx-user -# Copy over the wheel files -COPY dist/*.whl /app - -# Install the Python wheel -RUN pip install /app/*.whl - -# Install workflow and pipeline features -RUN pip install kedro kedro-viz ruff jupyter - # Switch to the new user USER nyx-user @@ -36,4 +27,17 @@ RUN mkdir -p $HOME/workspace WORKDIR /home/nyx-user/workspace +# Install workflow and pipeline features +RUN pip install kedro kedro-viz ruff jupyter + +# Make this available +ENV PATH="${PATH}:/home/nyx-user/.local/bin" + +# Copy over the wheel files +COPY dist/*.whl /app + +# Install the Python wheel +RUN pip install /app/*.whl + + CMD ["zsh"] From 26c14ba2b1de85271ab8a9a51111bbe845ffcfa9 Mon Sep 17 00:00:00 2001 From: Christopher Rabotin Date: Sat, 10 Jun 2023 22:02:01 -0600 Subject: [PATCH 11/15] Trying to switch to v4 of the docker push I don't think this will work either. Maybe changing it to `nyx-fds` works? --- .github/workflows/python.yml | 8 +++--- README.md | 48 +++++------------------------------- 2 files changed, 10 insertions(+), 46 deletions(-) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 6db920ec..613113f5 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -210,14 +210,14 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push Docker image with built package - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v4 with: context: . file: ./Dockerfile push: true tags: | - ghcr.io/nyx-space/nyx:${{ steps.short-sha.outputs.sha }} - ghcr.io/nyx-space/nyx:${{ github.ref == 'refs/heads/master' && 'latest' || steps.short-sha.outputs.sha }} - ghcr.io/nyx-space/nyx:${{ startsWith(github.ref, 'refs/tags/') && steps.get_version.outputs.VERSION || steps.short-sha.outputs.sha }} + ghcr.io/nyx-space/nyx-fds:${{ steps.short-sha.outputs.sha }} + ghcr.io/nyx-space/nyx-fds:${{ github.ref == 'refs/heads/master' && 'latest' || steps.short-sha.outputs.sha }} + ghcr.io/nyx-space/nyx-fds:${{ startsWith(github.ref, 'refs/tags/') && steps.get_version.outputs.VERSION || steps.short-sha.outputs.sha }} cache-from: type=local,src=/tmp/.buildx-cache cache-to: type=local,dest=/tmp/.buildx-cache \ No newline at end of file diff --git a/README.md b/README.md index 6c8cc133..b886d1f2 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ -# nyx -[Nyx](https://nyxspace.com) is a high fidelity, fast, reliable and **[validated]([https://nyxspace.com/MathSpec/](https://nyxspace.com/nyxspace/MathSpec/))** astrodynamics toolkit library written in Rust and available in Python. +# Nyx: Revolutionizing Flight Dynamics -The target audience is mission designers, astrodynamics engineers/hobbyists, and GNC engineers. The rationale for using Rust is to allow for very fast computations, guaranteed thread safety, -and portability to all platforms supported by [Rust](https://forge.rust-lang.org/platform-support.html). +**Blazing fast from mission concept to operations, and automation.** -- [https://nyxspace.com/](https://nyxspace.com/) + +Nyx is provided under the AGPLv3 License. By using this software, you assume responsibility for adhering to the license. Refer to [the pricing page](https://nyxspace.com/pricing/) for an FAQ on the AGPLv3 license. [![nyx-space on crates.io][cratesio-image]][cratesio] [![nyx-space on docs.rs][docsrs-image]][docsrs] @@ -13,41 +13,5 @@ and portability to all platforms supported by [Rust](https://forge.rust-lang.org [docsrs-image]: https://docs.rs/nyx-space/badge.svg [docsrs]: https://docs.rs/nyx-space/ -# License -The [AGPLv3 LICENSE](https://nyxspace.com/license/) is enforced. - -# Features - -## Propagation -- [x] Propagation with different Runge Kutta methods (validated in GMAT) -- [x] Convenient and explicit definition of the dynamics for a simulation (cf. [tests/orbitaldyn.rs](tests/orbitaldyn.rs)) -- [x] Propagation to different stopping conditions -- [x] Detect orbital events in other frames -## Dynamical models -- [x] Multibody dynamics using XB files -- [x] Finite burns with fuel depletion (including low thrust / ion propulsion) -- [x] Sub-Optimal Control of continuous thrust (e.g. Ruggerio, Petropoulos/Q-law) -- [x] Solar radiation pressure modeling -- [x] Basic drag models (cannonball) -- [x] Spherical harmonics -- [ ] Spacecraft attitude control and some useful optimal control algorithms -## Orbit determination -- [x] Statistical Orbit Determination: Classical and Extended Kalman Filter -- [x] Orbit Determination with multibody dynamics -- [x] Smoothing and iterations of CKFs -- [ ] Square Root Information Filer (SRIF) (removed in version 1.0.0-alpha.1) -- [x] An easy-to-use OD user interface -- [x] Estimation with spherical harmonics enabled -- [ ] Solar radiation pressure (SRP) parameter estimation ([#98](https://gitlab.com/chrisrabotin/nyx/issues/98)) -- [x] Covariance mapping and estimate frame transformations -- [x] State noise compensation (SNC) -- [ ] Dynamic model compensation (DMC) ([#86](https://gitlab.com/chrisrabotin/nyx/issues/86)) -- [x] High fidelity ground station placement -## Celestial computations -- [x] Orbital state manipulation -- [x] Planetary and Solar eclipse and visibility computation -- [x] Light-time corrections and aberrations -- [x] Frame rotations - -# Who am I? -An astrodynamics engineer with a heavy background in software. I currently work for Rocket Lab USA on the GNC of the Blue Ghost lunar lander. -- Find me on [LinkedIn](https://www.linkedin.com/in/chrisrabotin/). +## Who am I? +An GNC and flight dynamics engineer with a heavy background in software. I currently work for Rocket Lab USA on the Blue Ghost lunar lander. -- Find me on [LinkedIn](https://www.linkedin.com/in/chrisrabotin/). From f7c2296fc1d9d472469bdcbd96a0a04b8faef330 Mon Sep 17 00:00:00 2001 From: Christopher Rabotin Date: Sat, 10 Jun 2023 22:37:08 -0600 Subject: [PATCH 12/15] Trying to debug it --- .github/workflows/python.yml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 613113f5..1adcb052 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -175,7 +175,9 @@ jobs: uses: actions/checkout@v2 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 + uses: docker/setup-buildx-action@v2 + with: + buildkitd-flags: --debug - name: Cache Docker layers uses: actions/cache@v2 @@ -220,4 +222,14 @@ jobs: ghcr.io/nyx-space/nyx-fds:${{ github.ref == 'refs/heads/master' && 'latest' || steps.short-sha.outputs.sha }} ghcr.io/nyx-space/nyx-fds:${{ startsWith(github.ref, 'refs/tags/') && steps.get_version.outputs.VERSION || steps.short-sha.outputs.sha }} cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache \ No newline at end of file + cache-to: type=local,dest=/tmp/.buildx-cache + outputs: type=oci,dest=/tmp/image.tar + - + name: Import image in containerd + run: | + sudo ctr i import --base-name ghcr.io/nyx-space/nyx-fds:${{ steps.short-sha.outputs.sha }} --digests --all-platforms /tmp/image.tar + - + name: Push image with containerd + run: | + sudo ctr --debug i push --user "${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}" ghcr.io/nyx-space/nyx-fds:${{ steps.short-sha.outputs.sha }} + From 74fea863102e2d98c5455a4b0f7df3f310deb7f9 Mon Sep 17 00:00:00 2001 From: Christopher Rabotin Date: Sat, 10 Jun 2023 23:37:15 -0600 Subject: [PATCH 13/15] Try to not push --- .github/workflows/python.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 1adcb052..54f0b8f8 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -216,7 +216,7 @@ jobs: with: context: . file: ./Dockerfile - push: true + push: false tags: | ghcr.io/nyx-space/nyx-fds:${{ steps.short-sha.outputs.sha }} ghcr.io/nyx-space/nyx-fds:${{ github.ref == 'refs/heads/master' && 'latest' || steps.short-sha.outputs.sha }} From e58ac4c0a0063e45fc797eac7815024ac8fbe8d9 Mon Sep 17 00:00:00 2001 From: Christopher Rabotin Date: Sat, 10 Jun 2023 23:37:33 -0600 Subject: [PATCH 14/15] During debugging, let's not request this at the end of the pipeline --- .github/workflows/python.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 54f0b8f8..e3ea1b75 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -169,7 +169,7 @@ jobs: packaging: runs-on: ubuntu-latest - needs: [linux] # Don't package if the tests fail. + # needs: [linux] # Don't package if the tests fail. steps: - name: Check out code uses: actions/checkout@v2 From a5a5edf6bee8e3ac7fc1c8174d8c4d9b2d85276e Mon Sep 17 00:00:00 2001 From: Christopher Rabotin Date: Sun, 11 Jun 2023 00:32:34 -0600 Subject: [PATCH 15/15] Unacceptable crap by github permissions -- this also probably won't work --- .github/workflows/python.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index e3ea1b75..8ecd2fda 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -168,6 +168,7 @@ jobs: args: --skip-existing * packaging: + permissions: write-all runs-on: ubuntu-latest # needs: [linux] # Don't package if the tests fail. steps: