From 07c306ffcf8021ee7ca6f9a7f84667bdd044a69f Mon Sep 17 00:00:00 2001 From: JamesWrigley Date: Fri, 25 Oct 2024 19:32:25 +0200 Subject: [PATCH] Get the docs building and add a changelog Also add Julia 1 to the CI --- .github/workflows/ci.yml | 17 +++--- .gitignore | 1 + docs/Project.toml | 7 +++ docs/make.jl | 50 ++++++++++++----- docs/src/_changelog.md | 14 +++++ docs/src/index.md | 114 +++++++++++++++++++-------------------- src/DistributedNext.jl | 3 +- 7 files changed, 128 insertions(+), 78 deletions(-) create mode 100644 .gitignore create mode 100644 docs/src/_changelog.md diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a6a1e35..d4104fd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,6 +14,7 @@ concurrency: # Cancel intermediate builds: only pull request builds group: ${{ github.workflow }}-${{ github.ref }}-${{ github.ref != 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release-') || github.run_number }} cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} + jobs: test: name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }} @@ -23,6 +24,7 @@ jobs: matrix: version: - 'nightly' + - '1' os: - ubuntu-latest - macOS-latest @@ -58,18 +60,17 @@ jobs: with: file: lcov.info token: ${{ secrets.CODECOV_TOKEN }} + docs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: julia-actions/setup-julia@latest with: - # version: '1.6' - version: 'nightly' - - name: Generate docs - run: | - julia --color=yes -e 'write("Project.toml", replace(read("Project.toml", String), r"uuid = .*?\n" =>"uuid = \"47e2e46d-f89d-539d-b4ee-838fcccc9c8e\"\n"));' - julia --project --color=yes -e 'using Pkg; Pkg.activate("docs"); Pkg.instantiate(); Pkg.develop(PackageSpec(path = pwd()))' - julia --project=docs --color=yes docs/make.jl pdf + version: '1' + - name: Install dependencies + run: julia --project=docs/ -e 'using Pkg; Pkg.instantiate()' + - name: Build and deploy env: - DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: julia --project=docs/ docs/make.jl diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..de6b1c6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +docs/src/changelog.md diff --git a/docs/Project.toml b/docs/Project.toml index dfa65cd..bdc70e9 100644 --- a/docs/Project.toml +++ b/docs/Project.toml @@ -1,2 +1,9 @@ [deps] +Changelog = "5217a498-cd5d-4ec6-b8c2-9b85a09b6e3e" +DistributedNext = "fab6aee4-877b-4bac-a744-3eca44acbb6f" Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" +LiveServer = "16fef848-5104-11e9-1b77-fb7a48bbb589" +Revise = "295af30f-e4ad-537b-8983-00126c2a3abe" + +[sources] +DistributedNext = {path = ".."} diff --git a/docs/make.jl b/docs/make.jl index 9b652ca..3046f93 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -1,16 +1,42 @@ -using Distributed -using Documenter: DocMeta, makedocs, deploydocs +import Revise +import Changelog +using DistributedNext +import Documenter +using Documenter: Remotes, DocMeta, makedocs, deploydocs -DocMeta.setdocmeta!(Distributed, :DocTestSetup, :(using Distributed); recursive=true) +DocMeta.setdocmeta!(DistributedNext, :DocTestSetup, :(using DistributedNext); recursive=true) -makedocs(; - modules = [Distributed], - sitename = "Distributed", - pages = Any[ - "Distributed" => "index.md", - ], - checkdocs = :exports, - warnonly = [:cross_references], +# Always trigger a revise to pick up the latest docstrings. This is useful when +# working with servedocs(). If you are using servedocs(), run it like this: +# +# julia> servedocs(; include_dirs=["src"], skip_files=["docs/src/changelog.md"]) +# +# Otherwise it'll get into an infinite loop as the changelog is constantly +# regenerated and triggering LiveServer. +Revise.revise() + +# Build the changelog. Note that _changelog.md is the source and changelog.md is +# the destination. It's named that way for the vain reason of a nicer URL. +Changelog.generate( + Changelog.Documenter(), + joinpath(@__DIR__, "src/_changelog.md"), + joinpath(@__DIR__, "src/changelog.md"), + repo="JuliaParallel/DistributedNext.jl" ) -deploydocs(repo = "github.com/JuliaLang/Distributed.jl.git") +makedocs(; + repo = Remotes.GitHub("JuliaParallel", "DistributedNext.jl"), + format = Documenter.HTML( + prettyurls=get(ENV, "CI", "false") == "true", + size_threshold_warn=500_000, + size_threshold=600_000), + modules = [DistributedNext], + sitename = "DistributedNext", + pages = [ + "DistributedNext" => "index.md", + "changelog.md" + ], + warnonly = [:missing_docs, :cross_references], + ) + +deploydocs(repo = "github.com/JuliaParallel/DistributedNext.jl.git") diff --git a/docs/src/_changelog.md b/docs/src/_changelog.md new file mode 100644 index 0000000..014863b --- /dev/null +++ b/docs/src/_changelog.md @@ -0,0 +1,14 @@ +```@meta +CurrentModule = DistributedNext +``` + +# Changelog + +This documents notable changes in DistributedNext.jl. The format is based on +[Keep a Changelog](https://keepachangelog.com). + +## Unreleased + +### Changed +- Added a `project` argument to [`addprocs(::AbstractVector)`](@ref) to specify + the project of a remote worker ([#2]). diff --git a/docs/src/index.md b/docs/src/index.md index 22d63ce..fd88707 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -1,53 +1,53 @@ # [Distributed Computing](@id man-distributed) ```@docs -Distributed -Distributed.addprocs -Distributed.nprocs -Distributed.nworkers -Distributed.procs() -Distributed.procs(::Integer) -Distributed.workers -Distributed.rmprocs -Distributed.interrupt -Distributed.myid -Distributed.pmap -Distributed.RemoteException -Distributed.ProcessExitedException -Distributed.Future -Distributed.RemoteChannel -Distributed.fetch(::Distributed.Future) -Distributed.fetch(::RemoteChannel) -Distributed.remotecall(::Any, ::Integer, ::Any...) -Distributed.remotecall_wait(::Any, ::Integer, ::Any...) -Distributed.remotecall_fetch(::Any, ::Integer, ::Any...) -Distributed.remote_do(::Any, ::Integer, ::Any...) -Distributed.put!(::RemoteChannel, ::Any...) -Distributed.put!(::Distributed.Future, ::Any) -Distributed.take!(::RemoteChannel, ::Any...) -Distributed.isready(::RemoteChannel, ::Any...) -Distributed.isready(::Distributed.Future) -Distributed.AbstractWorkerPool -Distributed.WorkerPool -Distributed.CachingPool -Distributed.default_worker_pool -Distributed.clear! -Distributed.remote -Distributed.remotecall(::Any, ::AbstractWorkerPool, ::Any...) -Distributed.remotecall_wait(::Any, ::AbstractWorkerPool, ::Any...) -Distributed.remotecall_fetch(::Any, ::AbstractWorkerPool, ::Any...) -Distributed.remote_do(::Any, ::AbstractWorkerPool, ::Any...) -Distributed.@spawn -Distributed.@spawnat -Distributed.@fetch -Distributed.@fetchfrom -Distributed.@distributed -Distributed.@everywhere -Distributed.remoteref_id -Distributed.channel_from_id -Distributed.worker_id_from_socket -Distributed.cluster_cookie() -Distributed.cluster_cookie(::Any) +DistributedNext +DistributedNext.addprocs +DistributedNext.nprocs +DistributedNext.nworkers +DistributedNext.procs() +DistributedNext.procs(::Integer) +DistributedNext.workers +DistributedNext.rmprocs +DistributedNext.interrupt +DistributedNext.myid +DistributedNext.pmap +DistributedNext.RemoteException +DistributedNext.ProcessExitedException +DistributedNext.Future +DistributedNext.RemoteChannel +DistributedNext.fetch(::DistributedNext.Future) +DistributedNext.fetch(::RemoteChannel) +DistributedNext.remotecall(::Any, ::Integer, ::Any...) +DistributedNext.remotecall_wait(::Any, ::Integer, ::Any...) +DistributedNext.remotecall_fetch(::Any, ::Integer, ::Any...) +DistributedNext.remote_do(::Any, ::Integer, ::Any...) +DistributedNext.put!(::RemoteChannel, ::Any...) +DistributedNext.put!(::DistributedNext.Future, ::Any) +DistributedNext.take!(::RemoteChannel, ::Any...) +DistributedNext.isready(::RemoteChannel, ::Any...) +DistributedNext.isready(::DistributedNext.Future) +DistributedNext.AbstractWorkerPool +DistributedNext.WorkerPool +DistributedNext.CachingPool +DistributedNext.default_worker_pool +DistributedNext.clear! +DistributedNext.remote +DistributedNext.remotecall(::Any, ::AbstractWorkerPool, ::Any...) +DistributedNext.remotecall_wait(::Any, ::AbstractWorkerPool, ::Any...) +DistributedNext.remotecall_fetch(::Any, ::AbstractWorkerPool, ::Any...) +DistributedNext.remote_do(::Any, ::AbstractWorkerPool, ::Any...) +DistributedNext.@spawn +DistributedNext.@spawnat +DistributedNext.@fetch +DistributedNext.@fetchfrom +DistributedNext.@distributed +DistributedNext.@everywhere +DistributedNext.remoteref_id +DistributedNext.channel_from_id +DistributedNext.worker_id_from_socket +DistributedNext.cluster_cookie() +DistributedNext.cluster_cookie(::Any) ``` ## Cluster Manager Interface @@ -58,14 +58,14 @@ same host, and `SSHManager`, for launching on remote hosts via `ssh`. TCP/IP soc and transport messages between processes. It is possible for Cluster Managers to provide a different transport. ```@docs -Distributed.ClusterManager -Distributed.WorkerConfig -Distributed.launch -Distributed.manage -Distributed.kill(::ClusterManager, ::Int, ::WorkerConfig) -Distributed.connect(::ClusterManager, ::Int, ::WorkerConfig) -Distributed.init_worker -Distributed.start_worker -Distributed.process_messages -Distributed.default_addprocs_params +DistributedNext.ClusterManager +DistributedNext.WorkerConfig +DistributedNext.launch +DistributedNext.manage +DistributedNext.kill(::ClusterManager, ::Int, ::WorkerConfig) +DistributedNext.connect(::ClusterManager, ::Int, ::WorkerConfig) +DistributedNext.init_worker +DistributedNext.start_worker +DistributedNext.process_messages +DistributedNext.default_addprocs_params ``` diff --git a/src/DistributedNext.jl b/src/DistributedNext.jl index f229519..d5b66e9 100644 --- a/src/DistributedNext.jl +++ b/src/DistributedNext.jl @@ -1,7 +1,8 @@ # This file is a part of Julia. License is MIT: https://julialang.org/license """ -Tools for distributed parallel processing. +Tools for distributed parallel processing. This is a soft fork of Distributed.jl +for the purposes of testing new things before merging upstream. Here be dragons! """ module DistributedNext