Skip to content

Commit

Permalink
Update CI (#9)
Browse files Browse the repository at this point in the history
* Reconciling build config

* Correcting typo and CDDL errors

* Adding dictionary for CI
  • Loading branch information
BrianSipos authored Jan 16, 2025
1 parent 776b8fc commit 48116e5
Show file tree
Hide file tree
Showing 6 changed files with 84 additions and 62 deletions.
42 changes: 21 additions & 21 deletions .github/workflows/rfc-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,17 @@ name: RFC XML Check

on: [push]

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
build:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: dependencies
run: |
sudo apt-get install -y aspell cmake python3 python3-pip python3-setuptools python3-wheel ruby xmlstarlet
sudo pip3 install --upgrade pip
sudo apt-get install -y cmake python3 python3-pip python3-setuptools python3-wheel ruby xmlstarlet aspell cargo
sudo pip3 install xml2rfc
sudo gem install cddl
sudo gem install cbor-diag
sudo cargo install --root /usr/local cddl
- name: xml2rfc
run: |
cmake -S . -B build -DCMAKE_INSTALL_DOCDIR=$PWD/build/install
Expand All @@ -37,23 +25,35 @@ jobs:

deploy:
if: github.ref == 'refs/heads/main'

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

runs-on: ubuntu-latest
needs: build
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/[email protected]
with:
name: spec
path: build/install
- name: Setup Pages
uses: actions/configure-pages@v3
uses: actions/configure-pages@v4
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
uses: actions/upload-pages-artifact@v3
with:
path: build/install
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
uses: actions/deploy-pages@v4
19 changes: 10 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
# DTN UDPCL
# DTN UDP Convergence Layer Version 2 (UDPCLv2)

Source for for UDPCLbis draft document.
The internet-draft is hosted at [draft-ietf-dtn-udpcl](https://datatracker.ietf.org/doc/draft-ietf-dtn-udpcl/).

The final specification is hosted at [draft-ietf-dtn-udpcl](https://datatracker.ietf.org/doc/draft-ietf-dtn-udpcl/).

A local build of the current main branch is available [draft-ietf-dtn-udpcl.html](https://briansipos.github.io/dtn-bpbis-udpcl/draft-ietf-dtn-udpcl.html).
A local build of the current main branch is available [draft-ietf-dtn-udpcl.html](https://briansipos.github.io/dtn-bpbis-udpcl/draft-ietf-dtn-udpcl.html) with its [misspelling.txt](https://briansipos.github.io/dtn-bpbis-udpcl/misspelling.txt).
A difference from the datatracker draft and this local version can be [viewed side-by-side](https://author-tools.ietf.org/diff?doc_1=draft-ietf-dtn-udpcl&url_2=https://briansipos.github.io/dtn-bpbis-udpcl/draft-ietf-dtn-udpcl.txt&raw=1).

Prerequisites to building can be installed on Ubuntu with:
```
sudo apt-get install -y install aspell cmake python3 python3-pip python3-setuptools python3-wheel ruby xmlstarlet
sudo pip3 install xml2rfc
sudo gem install cddl
sudo apt-get install -y cmake python3 python3-pip python3-setuptools python3-wheel ruby xmlstarlet aspell cargo
pip3 install xml2rfc
sudo gem install cbor-diag
sudo cargo install --root /usr/local cddl
```
and then the document can be built with

Then the document can be built with
```
cmake -S . -B build/default
cmake --build build/default
Expand Down
70 changes: 42 additions & 28 deletions spec/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Inherit variables from top-level project
set(DRAFT_NAME "${PROJECT_NAME}")
set(DOC_INCLUDES )

find_program(XML2RFC xml2rfc)
if(NOT XML2RFC)
Expand All @@ -23,21 +24,38 @@ set(DRAFT_NAME_XML "${CMAKE_CURRENT_SOURCE_DIR}/${DRAFT_NAME}.xml")
set(DRAFT_NAME_TXT "${DRAFT_NAME}.txt")
set(DRAFT_NAME_HTML "${DRAFT_NAME}.html")
set(DRAFT_NAME_PDF "${DRAFT_NAME}.pdf")
set(DRAFT_NAME_EXPAND "${DRAFT_NAME}-exp.xml")
add_custom_command(
OUTPUT "${DRAFT_NAME_TXT}"
DEPENDS "${DRAFT_NAME_XML}"
DEPENDS "${DRAFT_NAME_XML}" ${DOC_INCLUDES}
COMMAND ${XML2RFC} --no-network --text -o "${DRAFT_NAME_TXT}" "${DRAFT_NAME_XML}"
)
add_custom_command(
OUTPUT "${DRAFT_NAME_HTML}"
DEPENDS "${DRAFT_NAME_XML}"
DEPENDS "${DRAFT_NAME_XML}" ${DOC_INCLUDES}
COMMAND ${XML2RFC} --no-network --html -o "${DRAFT_NAME_HTML}" "${DRAFT_NAME_XML}"
)
add_custom_command(
OUTPUT "${DRAFT_NAME_PDF}"
DEPENDS "${DRAFT_NAME_XML}"
DEPENDS "${DRAFT_NAME_XML}" ${DOC_INCLUDES}
COMMAND ${XML2RFC} --no-network --pdf -o "${DRAFT_NAME_PDF}" "${DRAFT_NAME_XML}"
)
add_custom_command(
OUTPUT "${DRAFT_NAME_EXPAND}"
DEPENDS "${DRAFT_NAME_XML}" ${DOC_INCLUDES}
COMMAND ${XML2RFC} --no-network --expand -o "${DRAFT_NAME_EXPAND}" "${DRAFT_NAME_XML}"
)
add_custom_target(
specs ALL
DEPENDS
"${DRAFT_NAME_TXT}"
"${DRAFT_NAME_HTML}"
"${DRAFT_NAME_EXPAND}"
)
add_custom_target(
pdf
DEPENDS "${DRAFT_NAME_PDF}"
)

set(DICTIONARY_TXT "${CMAKE_CURRENT_SOURCE_DIR}/dictionary.txt")
set(SPELLCHECK_XSL "${CMAKE_CURRENT_SOURCE_DIR}/spellcheck.xsl")
Expand All @@ -56,17 +74,19 @@ add_custom_command(
sort | uniq > "${MISSPELLING_TXT}"
)
add_custom_target(
specs ALL
DEPENDS "${DRAFT_NAME_TXT}" "${DRAFT_NAME_HTML}" "${MISSPELLING_TXT}"
)
add_custom_target(
pdf
DEPENDS "${DRAFT_NAME_PDF}"
misspelling ALL
DEPENDS "${MISSPELLING_TXT}"
COMMAND cat "${MISSPELLING_TXT}"
# success means file is present and empty
COMMAND test -f "${MISSPELLING_TXT}" -a ! -s "${MISSPELLING_TXT}"
COMMENT "Checking ${MISSPELLING_TXT}"
)

install(
FILES
"${CMAKE_CURRENT_BINARY_DIR}/${DRAFT_NAME_TXT}"
"${CMAKE_CURRENT_BINARY_DIR}/${DRAFT_NAME_HTML}"
"${CMAKE_CURRENT_BINARY_DIR}/${DRAFT_NAME_EXPAND}"
"${CMAKE_CURRENT_BINARY_DIR}/${MISSPELLING_TXT}"
TYPE DOC
)
Expand All @@ -78,14 +98,12 @@ if(NOT CBORVERIFY)
message(WARNING "No `diag2pretty.rb` found")
else()
set(CBORERRORS_TXT "cborerrors.txt")
add_custom_command(
OUTPUT "${CBORERRORS_TXT}"
DEPENDS "${DRAFT_NAME_XML}" "${SPLIT_ARTWORK}"
COMMAND ${PYTHON} "${SPLIT_ARTWORK}" "${DRAFT_NAME_XML}" '//sourcecode[@type="cbor"]' "${CBORVERIFY}" 2>"${CBORERRORS_TXT}" 1>&2 || true
)
add_custom_target(
cborerrors ALL
DEPENDS "${CBORERRORS_TXT}"
BYPRODUCTS "${CBORERRORS_TXT}"
DEPENDS "${DRAFT_NAME_XML}" "${SPLIT_ARTWORK}"
COMMAND ${PYTHON} "${SPLIT_ARTWORK}" "${DRAFT_NAME_XML}" '//sourcecode[@type="cbor"]' "${CBORVERIFY}" 2>"${CBORERRORS_TXT}" 1>&2
COMMENT "Generating ${CBORERRORS_TXT}"
)
install(
FILES "${CMAKE_CURRENT_BINARY_DIR}/${CBORERRORS_TXT}"
Expand Down Expand Up @@ -124,14 +142,12 @@ if(NOT CDDLTOOL)
message(WARNING "No `cddl` found")
else()
set(CDDLERRORS_TXT "cddlerrors.txt")
add_custom_command(
OUTPUT "${CDDLERRORS_TXT}"
DEPENDS "${COMBINED_CDDL}"
COMMAND ${CDDLTOOL} "${COMBINED_CDDL}" generate 10 2>"${CDDLERRORS_TXT}" 1>&2 || true
)
add_custom_target(
cddlerrors ALL
DEPENDS "${CDDLERRORS_TXT}"
BYPRODUCTS "${CDDLERRORS_TXT}"
DEPENDS "${COMBINED_CDDL}"
COMMAND ${CDDLTOOL} compile-cddl --cddl "${COMBINED_CDDL}" 2>"${CDDLERRORS_TXT}" 1>&2
COMMENT "Generating ${CDDLERRORS_TXT}"
)
install(
FILES "${CMAKE_CURRENT_BINARY_DIR}/${CDDLERRORS_TXT}"
Expand All @@ -145,14 +161,12 @@ else()
else()
set(CBORVALIDERRORS_TXT "cborvaliderrors.txt")
set(CHECK_CBOR "${CMAKE_CURRENT_SOURCE_DIR}/check_cbor.sh")
add_custom_command(
OUTPUT "${CBORVALIDERRORS_TXT}"
DEPENDS "${DRAFT_NAME_XML}" "${SPLIT_ARTWORK}" "${CHECK_CBOR}" "${COMBINED_CDDL}"
COMMAND ${PYTHON} "${SPLIT_ARTWORK}" "${DRAFT_NAME_XML}" '//sourcecode[@type="cbor"]' "${CHECK_CBOR}" "${COMBINED_CDDL}" 2>"${CBORVALIDERRORS_TXT}" 1>&2 || true
)
add_custom_target(
cborvalid ALL
DEPENDS "${CBORVALIDERRORS_TXT}"
cborvaliderrors ALL
BYPRODUCTS "${CBORVALIDERRORS_TXT}"
DEPENDS "${DRAFT_NAME_XML}" "${SPLIT_ARTWORK}" "${CHECK_CBOR}" "${COMBINED_CDDL}"
COMMAND ${PYTHON} "${SPLIT_ARTWORK}" "${DRAFT_NAME_XML}" '//sourcecode[@type="cbor"]' "${CHECK_CBOR}" "${COMBINED_CDDL}" 2>"${CBORVALIDERRORS_TXT}" 1>&2
COMMENT "Generating ${CBORVALIDERRORS_TXT}"
)
install(
FILES "${CMAKE_CURRENT_BINARY_DIR}/${CBORVALIDERRORS_TXT}"
Expand Down
5 changes: 4 additions & 1 deletion spec/check_cbor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,7 @@ SELFDIR=$(readlink -f $(dirname "${BASH_SOURCE[0]}"))

COMBINED_CDDL=$1

cat | diag2cbor.rb | cddl "${COMBINED_CDDL}" validate -
TMPFILE=$(mktemp)
cat | diag2cbor.rb >${TMPFILE}
cddl validate --cddl "${COMBINED_CDDL}" --cbor ${TMPFILE}
rm ${TMPFILE}
4 changes: 4 additions & 0 deletions spec/dictionary.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ ACK
acknowledgement
acknowledgements
anycast
APL
AQM
BCP
BER
Expand Down Expand Up @@ -55,11 +56,13 @@ IESG
IETF
incrementing
INIT
Internetwork
interoperation
IPADDR
iPAddress
IPsec
IPv
JHU
keepalive
Keepalive
kp
Expand Down Expand Up @@ -97,6 +100,7 @@ Retransmit
retransmitted
RKF
routable
RTT
Scalable
SMI
SSL
Expand Down
6 changes: 3 additions & 3 deletions spec/draft-ietf-dtn-udpcl.xml
Original file line number Diff line number Diff line change
Expand Up @@ -632,13 +632,13 @@ Receivers <bcp14>SHALL</bcp14> ignore extension items with unknown Extension ID
; CDDL cannot enforce type-specific requirements about other items
; being present (or not present) in the same map.
udpcl-ext-map = $udpcl-ext-map .within udpcl-ext-map-structure
$udpcl-ext-map = {
$udpcl-ext-map /= {
+ $$udpcl-ext-item
}
udpcl-ext-map-structure = {
+ ext-key =&gt; any
}
ext-key = ((-32768 .. 32767) .within int) .ne 0
ext-key = (-32768 .. 32767) .ne 0
</sourcecode>
</figure>
<t>
Expand Down Expand Up @@ -1027,7 +1027,7 @@ A transmitting entity <bcp14>SHALL NOT</bcp14> produce Transfer segments with ov
A transmitting entity <bcp14>SHOULD</bcp14> transmit Transfer segments in order of Segment Offset; this makes the behavior deterministic.
</t>
<t>
A receving entity <bcp14>SHALL</bcp14> maintain transfer reassembly state based on the tuple of packet source address-and-port and the Transfer ID sent by that source.
A receiving entity <bcp14>SHALL</bcp14> maintain transfer reassembly state based on the tuple of packet source address-and-port and the Transfer ID sent by that source.
This relies on the stability of source port numbers at least for the duration of a single transfer, as required by <xref target="sec-ext-transfer"/>.
See <xref target="sec-policy-udp-convo"/> for options and implications of source port number use.
</t>
Expand Down

0 comments on commit 48116e5

Please sign in to comment.