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
15 changes: 7 additions & 8 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ jobs:
if: github.event.pull_request.draft == false
needs: rubocop
runs-on: ubuntu-latest
permissions:
contents: read
actions: write # Buildx GHA cache read/write
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -62,9 +65,9 @@ jobs:
mv /tmp/gist/* test/fixtures
rm -rf /tmp/gist
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3
- name: Build
uses: docker/build-push-action@v2
uses: docker/build-push-action@v6
with:
context: .
file: Dockerfile
Expand All @@ -74,12 +77,8 @@ jobs:
VROOM_VERSION=${{ secrets.VROOM_VERSION }}
tags: optimizer-api:latest
outputs: type=docker,dest=/tmp/optimizer-api.tar
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,mode=max,dest=/tmp/.buildx-cache-new
- name: Move buildx cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Upload Docker image artifact
uses: actions/upload-artifact@v4
with:
Expand Down
8 changes: 7 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# syntax=docker/dockerfile:1.4
# Rosomaxa CLI is a musl binary. Pin matches the published GitHub/crates.io release.
ARG ROSOMAXA_VERSION=1.25.0
FROM ghcr.io/reinterpretcat/vrp/vrp-cli:${ROSOMAXA_VERSION} AS rosomaxa-cli

FROM ghcr.io/cartoway/optimizer-ortools:master

COPY --from=rosomaxa-cli /solver/vrp-cli /usr/local/bin/vrp-cli

ARG BUNDLE_WITHOUT="test development"
# Install Vroom
ARG VROOM_RELEASE=v1.14.0
Expand Down Expand Up @@ -94,7 +101,6 @@ ADD . /srv/app
EXPOSE 80

HEALTHCHECK \
--start-interval=1s \
--start-period=30s \
--interval=30s \
--timeout=20s \
Expand Down
16 changes: 9 additions & 7 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
source 'https://rubygems.org'
ruby '>= 3'
ruby '>= 3.2'

gem 'require_all'

Expand All @@ -12,19 +12,21 @@ gem 'rake'
gem 'thin'

# API
gem 'grape'
# ~> 3.2: ParamScopeTracker (thread-safe validation); keeps mustermann 3.x (sinatra/resque)
# grape >= 3.2 needs Ruby >= 3.2 (matches Docker/CI)
gem 'grape', '~> 3.2.0'
gem 'grape-entity'
gem 'grape_logging'
gem 'grape-swagger'
gem 'grape_logging', '>= 3.0'
gem 'grape-swagger', '~> 2.1', '>= 2.1.3' # 2.1.3+ allows grape < 4; 2.2 needs Ruby >= 3.1 OK
gem 'grape-swagger-entity'

# Models
gem 'actionpack', require: 'action_dispatch'
gem 'actionpack', '>= 7.2', require: 'action_dispatch'
# waiting for the following PRs to get merged and "released!"
# https://github.com/zilkey/active_hash/pull/231 and https://github.com/zilkey/active_hash/pull/233
gem 'active_hash'
gem 'activemodel'
gem 'activesupport', require: 'active_support'
gem 'activemodel', '>= 7.2'
gem 'activesupport', '>= 7.2', require: 'active_support'
gem 'google-protobuf', '>=3', require: 'google/protobuf'
gem 'oj'

Expand Down
151 changes: 85 additions & 66 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -24,28 +24,38 @@ GIT
GEM
remote: https://rubygems.org/
specs:
actionpack (7.0.8)
actionview (= 7.0.8)
activesupport (= 7.0.8)
rack (~> 2.0, >= 2.2.4)
actionpack (7.2.1.2)
actionview (= 7.2.1.2)
activesupport (= 7.2.1.2)
nokogiri (>= 1.8.5)
racc
rack (>= 2.2.4, < 3.2)
rack-session (>= 1.0.1)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
actionview (7.0.8)
activesupport (= 7.0.8)
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
useragent (~> 0.16)
actionview (7.2.1.2)
activesupport (= 7.2.1.2)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
erubi (~> 1.11)
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
active_hash (4.0.0)
activesupport (>= 6.1.0)
activemodel (7.0.8)
activesupport (= 7.0.8)
activesupport (7.0.8)
concurrent-ruby (~> 1.0, >= 1.0.2)
activemodel (7.2.1.2)
activesupport (= 7.2.1.2)
activesupport (7.2.1.2)
base64
bigdecimal
concurrent-ruby (~> 1.0, >= 1.3.1)
connection_pool (>= 2.2.5)
drb
i18n (>= 1.6, < 2)
logger (>= 1.4.2)
minitest (>= 5.1)
tzinfo (~> 2.0)
securerandom (>= 0.3)
tzinfo (~> 2.0, >= 2.0.5)
addressable (2.8.5)
public_suffix (>= 2.0.2, < 6.0)
ai4r (1.13)
Expand All @@ -57,66 +67,74 @@ GEM
benchmark (0.2.1)
benchmark-ips (2.12.0)
bigdecimal (4.1.2)
builder (3.2.4)
builder (3.3.0)
byebug (11.1.3)
charlock_holmes (0.7.9)
chunky_png (1.4.0)
color-generator (0.0.4)
concurrent-ruby (1.3.6)
concurrent-ruby (1.3.8)
connection_pool (3.0.2)
crack (0.4.5)
rexml
crass (1.0.6)
crass (1.0.7)
daemons (1.4.1)
diff-lcs (1.5.0)
docile (1.4.0)
domain_name (0.5.20190701)
unf (>= 0.0.5, < 1.0.0)
dotenv (3.1.7)
dry-core (1.0.1)
drb (2.2.3)
dry-configurable (1.3.0)
dry-core (~> 1.1)
zeitwerk (~> 2.6)
dry-core (1.2.0)
concurrent-ruby (~> 1.0)
logger
zeitwerk (~> 2.6)
dry-inflector (1.0.0)
dry-logic (1.5.0)
dry-inflector (1.3.1)
dry-logic (1.6.0)
bigdecimal
concurrent-ruby (~> 1.0)
dry-core (~> 1.0, < 2)
dry-core (~> 1.1)
zeitwerk (~> 2.6)
dry-types (1.7.1)
dry-types (1.9.1)
bigdecimal (>= 3.0)
concurrent-ruby (~> 1.0)
dry-core (~> 1.0)
dry-inflector (~> 1.0)
dry-logic (~> 1.4)
zeitwerk (~> 2.6)
e2mmap (0.1.0)
erubi (1.12.0)
erubi (1.13.1)
eventmachine (1.2.7)
geojson2image (0.2.2)
chunky_png (~> 1.3)
oj (~> 3.6)
google-protobuf (3.24.3-x86_64-linux)
grape (1.8.0)
activesupport (>= 5)
builder
grape (3.2.1)
activesupport (>= 7.2)
dry-configurable
dry-types (>= 1.1)
mustermann-grape (~> 1.0.0)
rack (>= 1.3.0)
rack-accept
grape-entity (1.0.0)
mustermann-grape (~> 1.1.0)
rack (>= 2)
zeitwerk
grape-entity (1.1.0)
activesupport (>= 3.0.0)
multi_json (>= 1.3.2)
grape-swagger (1.6.1)
grape (~> 1.3)
grape-swagger-entity (0.5.2)
grape-entity (>= 0.6.0)
grape-swagger (>= 1.2.0)
grape_logging (1.8.4)
grape
grape-swagger (2.2.0)
grape (>= 2.1, < 5.0)
grape-swagger-entity (0.7.1)
grape-entity (~> 1)
grape-swagger (~> 2)
grape_logging (3.0.1)
grape (>= 2.4.0)
rack
zeitwerk
hashdiff (1.0.1)
http-accept (1.7.0)
http-cookie (1.0.5)
domain_name (~> 0.5)
http_accept_language (2.1.1)
i18n (1.14.8)
i18n (1.15.2)
concurrent-ruby (~> 1.0)
jaro_winkler (1.5.6)
json (2.7.1)
Expand All @@ -125,13 +143,14 @@ GEM
kramdown-parser-gfm (1.1.0)
kramdown (~> 2.0)
language_server-protocol (3.17.0.3)
loofah (2.21.3)
logger (1.7.0)
loofah (2.25.2)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
mime-types (3.5.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2023.0808)
minitest (5.26.1)
minitest (5.27.0)
minitest-around (0.5.0)
minitest (~> 5.0)
minitest-bisect (1.7.0)
Expand All @@ -150,14 +169,13 @@ GEM
minitest (~> 5.16)
minitest-stub_any_instance (1.0.3)
mono_logger (1.1.2)
multi_json (1.15.0)
mustermann (3.0.0)
ruby2_keywords (~> 0.0.1)
mustermann-grape (1.0.2)
multi_json (1.21.2)
mustermann (3.1.1)
mustermann-grape (1.1.0)
mustermann (>= 1.0.0)
netrc (0.11.0)
nio4r (2.5.9)
nokogiri (1.15.4-x86_64-linux)
nokogiri (1.19.4-x86_64-linux-gnu)
racc (~> 1.4)
oj (3.17.3)
bigdecimal (>= 3.0)
Expand All @@ -172,10 +190,8 @@ GEM
public_suffix (5.0.3)
puma (6.3.1)
nio4r (~> 2.0)
racc (1.7.3)
rack (2.2.8)
rack-accept (0.4.5)
rack (>= 0.4)
racc (1.8.1)
rack (2.2.24)
rack-contrib (2.3.0)
rack (~> 2.0)
rack-cors (2.0.1)
Expand All @@ -184,15 +200,17 @@ GEM
rack (~> 2.2, >= 2.2.4)
rack-server-pages (0.1.0)
rack
rack-test (2.1.0)
rack-session (1.0.2)
rack (< 3)
rack-test (2.2.0)
rack (>= 1.3)
rails-dom-testing (2.2.0)
rails-dom-testing (2.3.0)
activesupport (>= 5.0.0)
minitest
nokogiri (>= 1.6)
rails-html-sanitizer (1.6.0)
loofah (~> 2.21)
nokogiri (~> 1.14)
rails-html-sanitizer (1.7.1)
loofah (~> 2.25, >= 2.25.2)
nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
rainbow (3.1.1)
rake (13.4.2)
rake-compiler-dock (1.12.0)
Expand Down Expand Up @@ -248,7 +266,7 @@ GEM
rubocop (>= 1.7.0, < 2.0)
rubocop-ast (>= 0.4.0)
ruby-progressbar (1.13.0)
ruby2_keywords (0.0.5)
securerandom (0.4.1)
sentry-resque (5.18.2)
resque (>= 1.24)
sentry-ruby (~> 5.18.2)
Expand Down Expand Up @@ -293,35 +311,36 @@ GEM
unf_ext
unf_ext (0.0.8.2)
unicode-display_width (2.5.0)
useragent (0.16.11)
vegas (0.1.11)
rack (>= 1.0.0)
webmock (3.19.1)
addressable (>= 2.8.0)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
yard (0.9.34)
zeitwerk (2.6.11)
zeitwerk (2.8.3)

PLATFORMS
x86_64-linux

DEPENDENCIES
actionpack
actionpack (>= 7.2)
active_hash
activemodel
activesupport
activemodel (>= 7.2)
activesupport (>= 7.2)
ai4r
balanced_vrp_clustering!
benchmark-ips
byebug
charlock_holmes
dotenv
google-protobuf (>= 3)
grape
grape (~> 3.2.0)
grape-entity
grape-swagger
grape-swagger (~> 2.1, >= 2.1.3)
grape-swagger-entity
grape_logging
grape_logging (>= 3.0)
http_accept_language
i18n
minitest
Expand Down Expand Up @@ -359,7 +378,7 @@ DEPENDENCIES
webmock

RUBY VERSION
ruby 3.0.6p216
ruby 3.2.2p53

BUNDLED WITH
2.4.19
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Run an optimizer REST API depending of many constraints for a Vehicle Routing Pr
This project use some solver engines:
* [Vroom v1.14.0](https://github.com/VROOM-Project/vroom/releases/tag/v1.14.0)
* [Optimizer-ortools v1.17.1](https://github.com/cartoroute/optimizer-ortools) & [OR-Tools v7.8](https://github.com/google/or-tools/releases/tag/v7.8) (use the version corresponding to your system operator, not source code).
* [vrp-cli 1.25.0](https://github.com/reinterpretcat/vrp/releases/tag/v1.25.0) (Rosomaxa, Apache-2.0, separate process). Service `:rosomaxa`, appended after the existing solvers. Covers matrix problems with single-activity services, a vehicle start, an optional end (open route), capacities, time windows, simple shipments, reload depots and lunch breaks. A missing start depot, regulatory rests, and relations other than simple shipments are skipped. `maximum_reloads` is not enforced.

## API

Expand Down
Loading
Loading