Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/dev-2.x' into upstream-merge-2…
Browse files Browse the repository at this point in the history
…024-01-11
  • Loading branch information
leonardehrenfried committed Jan 11, 2024
2 parents e16ed35 + 43438ba commit 8e9d910
Show file tree
Hide file tree
Showing 283 changed files with 2,184 additions and 1,564 deletions.
11 changes: 0 additions & 11 deletions .github/workflows/cibuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,6 @@ jobs:
distribution: temurin
cache: maven

- name: Build debug client
working-directory: ./client-next
run: |
npm install
npm run build
- name: Prepare coverage agent, build and test
# these are split into two steps because otherwise maven keeps long-running HTTP connections
# to Maven Central open which then hang during the package phase because the Azure (Github Actions)
Expand Down Expand Up @@ -259,11 +253,6 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: 18
- name: Build debug client
working-directory: ./client-next
run: |
npm install
npm run build
- name: Build container image with Jib, push to Dockerhub
env:
CONTAINER_REPO: docker.io/opentripplanner/opentripplanner
Expand Down
87 changes: 87 additions & 0 deletions .github/workflows/debug-client.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: Debug client

on:
push:
paths:
- 'client-next/**'
pull_request:
paths:
- 'client-next/**'

# to avoid conflicts, make sure that only one workflow pushes to Github at the same time
concurrency:
group: github-push

jobs:
debug-client:
if: github.repository_owner == 'opentripplanner'
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
# this is necessary so that the correct credentials are put into the git configuration
# when we push to dev-2.x and push the compiled output to the git repo
- uses: actions/checkout@v4
if: github.event_name == 'push'
with:
token: ${{ secrets.CHANGELOG_TOKEN }}
fetch-depth: 0

# for a simple PR where we don't push, we don't need any credentials
- uses: actions/checkout@v4
if: github.event_name == 'pull_request'

- uses: actions/setup-node@v3
with:
node-version: 18

- name: Set version
run: echo "VERSION=`date +%Y/%m/%Y-%m-%dT%H:%M`" >> $GITHUB_ENV

- name: Build debug client
working-directory: client-next
run: |
npm install
npm run build -- --base https://cdn.jsdelivr.net/gh/opentripplanner/debug-client-assets@main/${VERSION}/
- name: Deploy compiled assets to repo
if: github.event_name == 'push' && github.ref == 'refs/heads/dev-2.x'
env:
REMOTE: debug-client
LOCAL_BRANCH: local-assets
REMOTE_BRANCH: main
TOKEN: ${{ secrets.CHANGELOG_TOKEN }}
run: |
# Configure git user
git config --global user.name 'OTP Bot'
git config --global user.email '[email protected]'
# Fetch the assets repo
git remote add $REMOTE https://[email protected]/opentripplanner/debug-client-assets.git
git fetch --depth=1 $REMOTE $REMOTE_BRANCH:$LOCAL_BRANCH
git checkout $LOCAL_BRANCH
# Copy the compiled output to a versioned folder
mkdir -p $VERSION
rsync -r client-next/output/* ./$VERSION/
git add $VERSION
git commit -am "Add version ${VERSION} of debug client"
# Push to assets repo https://github.com/opentripplanner/debug-client-assets
git push $REMOTE $LOCAL_BRANCH:$REMOTE_BRANCH
# Switch back to the OTP code
git checkout dev-2.x
git pull --rebase
CLIENT_HTML_OUTPUT=src/client/debug-client-preview/index.html
mkdir -p src/client/debug-client-preview/
cp client-next/output/index.html ${CLIENT_HTML_OUTPUT}
# just to debug
cat ${CLIENT_HTML_OUTPUT}
git add -f ${CLIENT_HTML_OUTPUT}
git commit -m "Upgrade debug client to version ${VERSION}"
git push ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git HEAD:dev-2.x
2 changes: 1 addition & 1 deletion .github/workflows/performance-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

jobs:
perf-test:
if: github.repository_owner == 'opentripplanner' && !startsWith(github.event.head_commit.message ,'Bump serialization version id for')
if: github.repository_owner == 'opentripplanner' && !startsWith(github.event.head_commit.message ,'Bump serialization version id for') && !startsWith(github.event.head_commit.message ,'Upgrade debug client to version')
runs-on: performance-test
strategy:
fail-fast: false
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/post-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ on:
- dev-2.x
types: [closed]

# to avoid conflicts, make sure that only one workflow pushes to Github at the same time
concurrency:
group: github-push

jobs:
changelog-entry:
if: github.event.pull_request.merged && github.repository_owner == 'opentripplanner' && !contains(github.event.pull_request.labels.*.name, 'skip changelog')
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ gen-py/
node_modules/
target/
/graphs
/src/client/debug-client-preview/

# for local dev only
/src/test/resources/speedtest/travelSearch-results-*.csv
Expand Down
2 changes: 2 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ Any message posted there will be seen by most of the contributors, some of whom
time. It will also create a record of the discussion that will be useful to the larger community and
often leads to issues being discussed at the twice-weekly development meetings.

## Developer meetings

OTP development meetings usually occur twice a week. These meetings are open to anyone who wants to
join, even if you simply want to observe the process or ask a few questions. The most effective way
to advance pull requests and collaborate is to participate directly in these meetings. The meeting
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import { Leg } from '../../gql/graphql.ts';
import { useHeaderLegContentStyleCalculations } from './useHeaderLegContentStyleCalculations.ts';
const modeIcons = import.meta.glob('../../static/img/mode/*.png', { as: 'url', eager: true });

function getModeIconUrl(leg: Leg) {
return modeIcons[`../../static/img/mode/${leg.mode.toLowerCase()}.png`];
}

export function ItineraryHeaderLegContent({
leg,
Expand All @@ -22,6 +27,8 @@ export function ItineraryHeaderLegContent({
pxSpan,
);

const legIconImageUrl = getModeIconUrl(leg);

return (
<div
className="itinerary-header-leg-wrapper"
Expand All @@ -36,8 +43,8 @@ export function ItineraryHeaderLegContent({
className="itinerary-header-leg-icon"
style={{
background: legTextColor,
maskImage: `url(/debug-client-preview/img/mode/${leg.mode.toLowerCase()}.png)`,
WebkitMaskImage: `url(/debug-client-preview/img/mode/${leg.mode.toLowerCase()}.png)`,
maskImage: `url(${legIconImageUrl})`,
WebkitMaskImage: `url(${legIconImageUrl})`,
}}
></div>
{showPublicCode && <span className="itinerary-header-leg-public-code">{leg.line?.publicCode}</span>}
Expand Down
6 changes: 4 additions & 2 deletions client-next/src/components/MapView/NavigationMarkers.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { TripQueryVariables } from '../../gql/graphql.ts';
import { Marker } from 'react-map-gl';
import markerFlagStart from '../../static/img/marker-flag-start-shadowed.png';
import markerFlagEnd from '../../static/img/marker-flag-end-shadowed.png';

export function NavigationMarkers({
tripQueryVariables,
Expand Down Expand Up @@ -27,7 +29,7 @@ export function NavigationMarkers({
}}
anchor="bottom-right"
>
<img alt="" src="/debug-client-preview/img/marker-flag-start-shadowed.png" height={48} width={49} />
<img alt="" src={markerFlagStart} height={48} width={49} />
</Marker>
)}
{tripQueryVariables.to.coordinates && (
Expand All @@ -45,7 +47,7 @@ export function NavigationMarkers({
}}
anchor="bottom-right"
>
<img alt="" src="/debug-client-preview/img/marker-flag-end-shadowed.png" height={48} width={49} />
<img alt="" src={markerFlagEnd} height={48} width={49} />
</Marker>
)}
</>
Expand Down
10 changes: 2 additions & 8 deletions client-next/src/components/SearchBar/SearchBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { ItineraryFilterDebugSelect } from './ItineraryFilterDebugSelect.tsx';
import Navbar from 'react-bootstrap/Navbar';
import { ServerInfoTooltip } from './ServerInfoTooltip.tsx';
import { useRef, useState } from 'react';
import logo from '../../static/img/otp-logo.svg';

type SearchBarProps = {
onRoute: () => void;
Expand All @@ -31,14 +32,7 @@ export function SearchBar({ onRoute, tripQueryVariables, setTripQueryVariables,
<div className="search-bar top-content">
<Navbar.Brand onClick={() => setShowServerInfo((v) => !v)}>
<div style={{ position: 'relative' }} ref={target}>
<img
alt=""
src="/debug-client-preview/img/otp-logo.svg"
width="30"
height="30"
className="d-inline-block align-top"
/>{' '}
OTP Debug Client
<img alt="" src={logo} width="30" height="30" className="d-inline-block align-top" /> OTP Debug Client
{showServerInfo && <ServerInfoTooltip serverInfo={serverInfo} target={target} />}
</div>
</Navbar.Brand>
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
2 changes: 1 addition & 1 deletion client-next/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default defineConfig({
plugins: [react()],
base: '/debug-client-preview/',
build: {
outDir: '../src/client/debug-client-preview',
outDir: 'output',
emptyOutDir: true,
},
});
18 changes: 9 additions & 9 deletions doc-templates/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ The result will look like this:
}
```

# System-wide Configuration
## System-wide Configuration

Using the file `otp-config.json` you can enable or disable different APIs and experimental
[Sandbox Extensions](SandboxExtension.md). By default, all supported APIs are enabled and all
Expand All @@ -185,7 +185,7 @@ Features that can be toggled in this file are generally only affect the routing
but for consistency all such "feature flags", even those that would affect graph building, are
managed in this one file.

## OTP Features
### OTP Features

Here is a list of all features which can be toggled on/off and their default values.

Expand All @@ -205,27 +205,27 @@ Here is a list of all features which can be toggled on/off and their default val
```


# JVM configuration
## JVM configuration

This section contains general recommendations for tuning the JVM in a production environment.
It focuses mainly on garbage collection configuration and memory settings.
See [Garbage Collector Tuning](https://docs.oracle.com/en/java/javase/17/gctuning/introduction-garbage-collection-tuning.html) for general information on garbage collection.
See [Large Pages in Java](https://kstefanj.github.io/2021/05/19/large-pages-and-java.html) and [Transparent Huge Pages](https://shipilev.net/jvm/anatomy-quarks/2-transparent-huge-pages) for general information on large memory pages.


## OTP server
### OTP server

The OTP server processes concurrent routing requests in real time.
The main optimization goal for the OTP server is minimizing response time.


### Garbage collector
#### Garbage collector

- The G1 garbage collector (default since Java 9) offers a good compromise between low latency (i.e. low GC pause time) and GC overhead.
- If latency spikes are an issue, the ZGC garbage collector is an alternative. It produces in general more overhead than G1.


### Memory settings
#### Memory settings

- Using Large Memory Pages can reduce pressure on the TLB cache and increase performance.
- It is in general not recommended to use large memory page in _Transparent Huge Page_ mode (`-XX:+UseTransparentHugePages`) for latency-sensitive applications, since memory is allocated on-demand and this can induce latency spikes if the memory is fragmented.
Expand All @@ -235,20 +235,20 @@ The physical memory can be committed upfront, at JVM startup time. This can be d
Example: `-Xms18g -Xmx18g -XX:+UseTransparentHugePages -XX:+AlwaysPreTouch`


## Graph Builder
### Graph Builder

The Graph Builder is the non-interactive mode used to build street graphs and transit graphs.
The main optimization goal for the Graph Builder is minimizing total build time.


### Garbage collector
#### Garbage collector

- In theory, the Parallel garbage collector offers the best throughput.
In practice, it can be challenging to optimize the Parallel GC to build both a street graph and a transit graph, the memory usage patterns being different.
- The G1 garbage collector provides in general a good compromise.


### Memory settings
#### Memory settings

- Using Large Memory Pages can reduce pressure on the TLB cache and increase performance.
- Since latency is not an issue, Large Memory Pages can be used indifferently in _TLBFS_ mode (`-XX:+UseHugeTLBFS`) or _Transparent Huge Page_ mode (`-XX:+UseTransparentHugePages`)
4 changes: 3 additions & 1 deletion docs/Basic-Tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ states, from which you can prepare your own smaller bounding-box extracts
using [Osmosis](http://wiki.openstreetmap.org/wiki/Osmosis#Extracting_bounding_boxes)
, [osmconvert](http://wiki.openstreetmap.org/wiki/Osmconvert#Applying_Geographical_Borders), or (our
favorite) [Osmium-Tool](https://osmcode.org/osmium-tool/manual.html#creating-geographic-extracts).
There is also [Protomaps](https://app.protomaps.com/) which can create custom extracts
for any region of the world with an easy to use drag and drop interface.
OSM data can be delivered as XML or in the more compact binary PBF format. OpenTripPlanner consumes
only PBF because it's smaller and more efficient.

Expand Down Expand Up @@ -202,4 +204,4 @@ You can run the OTP .jar file with the `--help` option for a full list of comman

## Exploring the API

If you want to learn how to use OTP's API's, check out the [GraphQL tutorial](apis/GraphQL-Tutorial.md).
If you want to learn how to use OTP's API's, check out the [GraphQL tutorial](apis/GraphQL-Tutorial.md).
11 changes: 10 additions & 1 deletion docs/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ based on merged pull requests. Search GitHub issues and pull requests for smalle
- Fix serialization of `AtomicInteger` [#5508](https://github.com/opentripplanner/OpenTripPlanner/pull/5508)
- Improve linking of fixed stops used by flex trips [#5503](https://github.com/opentripplanner/OpenTripPlanner/pull/5503)
- Keep min transfer filter is not local to group-by-filters [#5436](https://github.com/opentripplanner/OpenTripPlanner/pull/5436)
- Add paging deduplication when cropping. [#5458](https://github.com/opentripplanner/OpenTripPlanner/pull/5458)
- Add paging deduplication when cropping [#5458](https://github.com/opentripplanner/OpenTripPlanner/pull/5458)
- Consolidate equivalent stops from several feeds [#5429](https://github.com/opentripplanner/OpenTripPlanner/pull/5429)
- Check transport mode when mapping GroupStops [#5518](https://github.com/opentripplanner/OpenTripPlanner/pull/5518)
- Cleanup trip times - Part A [#5437](https://github.com/opentripplanner/OpenTripPlanner/pull/5437)
Expand All @@ -63,6 +63,15 @@ based on merged pull requests. Search GitHub issues and pull requests for smalle
- Make Transmodel GraphQl API an official OTP API [#5573](https://github.com/opentripplanner/OpenTripPlanner/pull/5573)
- Add option to include stations in `nearest` search [#5390](https://github.com/opentripplanner/OpenTripPlanner/pull/5390)
- GTFS Flex spec update: separate columns for `location_id`, `location_group_id` [#5564](https://github.com/opentripplanner/OpenTripPlanner/pull/5564)
- Report NO_TRANSIT_CONNECTION when search-window is set. [#5570](https://github.com/opentripplanner/OpenTripPlanner/pull/5570)
- Transit priority - part 3 [#5583](https://github.com/opentripplanner/OpenTripPlanner/pull/5583)
- Fix preference cost comparisons [#5586](https://github.com/opentripplanner/OpenTripPlanner/pull/5586)
- Report and throw away trip-times which fail sanity check [#5587](https://github.com/opentripplanner/OpenTripPlanner/pull/5587)
- Consider escalator edges in island pruning [#5591](https://github.com/opentripplanner/OpenTripPlanner/pull/5591)
- Create own rental preferences for bike and car in the internal model [#5562](https://github.com/opentripplanner/OpenTripPlanner/pull/5562)
- Adding situation-version to TransmodelGraphQL API [#5592](https://github.com/opentripplanner/OpenTripPlanner/pull/5592)
- Move REST API into sandbox [#5580](https://github.com/opentripplanner/OpenTripPlanner/pull/5580)
- Fix high walk reluctance leading to zero egress results for rental searches [#5605](https://github.com/opentripplanner/OpenTripPlanner/pull/5605)
[](AUTOMATIC_CHANGELOG_PLACEHOLDER_DO_NOT_REMOVE)

## 2.4.0 (2023-09-13)
Expand Down
Loading

0 comments on commit 8e9d910

Please sign in to comment.