Skip to content

Commit

Permalink
TPA-mix (#1873)
Browse files Browse the repository at this point in the history
  • Loading branch information
PiTrem committed Apr 15, 2024
1 parent a38559d commit 7346f79
Show file tree
Hide file tree
Showing 812 changed files with 62,192 additions and 27,132 deletions.
4 changes: 2 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@
],
"postCreateCommand": [
"/bin/bash",
".devcontainer/post_create.sh"
"prepare-ruby-dev.sh"
],
"remoteUser": "chemotion-dev", // see https: //aka.ms/vscode-remote/containers/non-root
"shutdownAction": "stopCompose", // stop compose when quitting
"overrideCommand": true, // override the commands in the compose file
"overrideCommand": true, // The 'app' container (which vscode is using as the devontainer) dies, as soon as we are killing the rails server that is started in the 'app' container command. To prevent this we override the 'app' container command from the the compose file.
"containerEnv": {
"RAILS_ENV": "development"
},
Expand Down
8 changes: 0 additions & 8 deletions .devcontainer/post_create.sh

This file was deleted.

1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
backup
uploads
public
!/public/ontologies_default/
.gitignore
node_modules
tmp
Expand Down
7 changes: 7 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@
"no-relative-import-paths/no-relative-import-paths": [
"error",
{ "allowSameFolder": false, "rootDir": "app/packs" }
],
"max-len": [
"error",
{
"code": 120,
"ignoreComments": true
}
]
},
"settings": {
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,10 @@ jobs:
- uses: ruby/setup-ruby@v1
with:
ruby-version: '2.7.7'
ruby-version: '3.3.0'

- name: install linting dependencies
# IMPORTANT: install rubocop first for pinning to take effect (`gem` doesn't resolve dependencies but simply installs gems in order)
run: gem install rubocop:1.37.1 pronto pronto-rubocop rubocop-rspec rubocop-rails rubocop-performance # TODO: unpin rubocop once it's not breaking pronto anymore (as does rubocop:1.38.0)
run: gem install rubocop pronto pronto-rubocop rubocop-rspec rubocop-rails rubocop-performance

- name: run Pronto
run: pronto run -f github_status github_pr_review -c origin/${{ github.base_ref }}
Expand All @@ -49,7 +48,7 @@ jobs:
run:
shell: bash

container: complat/chemotion_eln_runner:v1.6.0-1
container: complat/chemotion_eln_runner:main

services:
postgres:
Expand Down
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@
/config/scifinder_n.yml
/config/radar.yml

/doc/*

/node_modules

/public/images/molecules/*
Expand Down Expand Up @@ -93,6 +95,8 @@
!/public/ontologies/rxno.default.json
!/public/ontologies/rxno.default.edited.json

/public/data_type.json

/uploads/*
!/public/attachments/.keep

Expand Down Expand Up @@ -145,6 +149,7 @@
aliasifyConfig.js
/app/assets/javascripts/components/extra/*
/app/packs/src/components/extra/*
/app/packs/klasses.json

# Backups folder
backup/deploy_backup
Expand Down Expand Up @@ -189,3 +194,8 @@ public/sprite.png

#svgeditor
/public/svgedit

!spec/fixtures/import/sample_import_template.xlsx

# generic elements
data/klasses.json
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v14.21.3
v18.19.1
5 changes: 3 additions & 2 deletions .service-dependencies
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#syntax=v1
CONVERTER=ComPlat/chemotion-converter-app@v0.9.0
CONVERTER=ComPlat/chemotion-converter-app@v1.2.0
KETCHER=ptrxyz/chemotion-ketchersvc@main
SPECTRA=ComPlat/chem-spectra-app@0.12.0
SPECTRA=ComPlat/chem-spectra-app@1.1.1
NMRIUMWRAPPER=NFDI4Chem/nmrium-react-wrapper@v0.4.0
4 changes: 2 additions & 2 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
nodejs 14.21.3
ruby 2.7.7
nodejs 18.19.1
ruby 2.7.8
24 changes: 24 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"sqltools.connections": [
{
"previewLimit": 50,
"server": "postgres",
"port": 5432,
"driver": "PostgreSQL",
"name": "development",
"database": "chemotion_dev",
"username": "postgres",
"password": ""
},
{
"previewLimit": 50,
"server": "postgres",
"port": 5432,
"driver": "PostgreSQL",
"name": "test",
"database": "chemotion_test",
"username": "postgres",
"password": ""
}
],
}
7 changes: 6 additions & 1 deletion .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@
"type": "shell",
"command": "RAILS_ENV=test $(which bundle) exec rails server -b 0.0.0.0 -p 3000"
},
{
"label": "Rails - delayed job worker",
"type": "shell",
"command": "RAILS_ENV=development $(which bundle) exec rake jobs:work"
},
{
"label": "RSpec - all",
"type": "shell",
Expand All @@ -40,4 +45,4 @@
"command": "$(which bundle) exec rubocop -c .rubocop.yml -a ${file}",
},
]
}
}
362 changes: 351 additions & 11 deletions CHANGELOG.md

Large diffs are not rendered by default.

21 changes: 4 additions & 17 deletions Dockerfile.chemotion-dev
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,11 @@
FROM --platform=linux/amd64 ubuntu:jammy

ARG DEBIAN_FRONTEND=noninteractive
ARG VRUBY=2.7.7
ARG VNODE=14.21.3
ARG VNODENEXT=16.16.0
ARG ASDF_BRANCH=v0.11.3

RUN set -xe && apt-get update -yqqq --fix-missing && apt-get upgrade -y
RUN apt update && apt-get install -yqq --fix-missing bash ca-certificates wget apt-transport-https git gpg\
imagemagick libmagic-dev libmagickcore-dev libmagickwand-dev curl gnupg2 \
build-essential nodejs sudo postgresql-client libappindicator1 swig \
build-essential sudo postgresql-client libappindicator1 swig \
gconf-service libasound2 libgconf-2-4 cmake \
libnspr4 libnss3 libpango1.0-0 libxss1 xdg-utils tzdata libpq-dev \
gtk2-engines-pixbuf \
Expand All @@ -25,7 +21,8 @@ RUN apt update && apt-get install -yqq --fix-missing bash ca-certificates wget a
fonts-crosextra-caladea fonts-crosextra-carlito \
fonts-dejavu fonts-dejavu-core fonts-dejavu-extra fonts-liberation2 fonts-liberation \
fonts-linuxlibertine fonts-noto-core fonts-noto-extra fonts-noto-ui-core \
fonts-opensymbol fonts-sil-gentium fonts-sil-gentium-basic inkscape
fonts-opensymbol fonts-sil-gentium fonts-sil-gentium-basic inkscape \
libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libxtst6 xauth xvfb
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
&& echo "deb http://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google.list \
&& apt-get update -yqqq && apt-get -y install google-chrome-stable \
Expand All @@ -49,20 +46,10 @@ RUN mkdir /home/chemotion-dev/node_modules

SHELL ["/bin/bash", "-c"]

RUN git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch $ASDF_BRANCH

# Even if asdf and the related tools are only installed by running run-ruby-dev.sh, we set the PATH variables here, so when we enter the container via docker exec, we have the path set correctly
ENV ASDF_DIR=/home/chemotion-dev/.asdf
ENV PATH=/home/chemotion-dev/.asdf/shims:/home/chemotion-dev/.asdf/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

RUN asdf plugin add nodejs https://github.com/asdf-vm/asdf-nodejs.git
RUN asdf install nodejs $VNODE
RUN asdf install nodejs $VNODENEXT
RUN asdf global nodejs $VNODE

RUN asdf plugin add ruby https://github.com/asdf-vm/asdf-ruby.git
RUN asdf install ruby $VRUBY
RUN asdf global ruby $VRUBY

RUN echo 'network-timeout 600000' > /home/chemotion-dev/.yarnrc
# use node modules from outside the application directory
RUN echo '--modules-folder /home/chemotion-dev/node_modules/' >> /home/chemotion-dev/.yarnrc
5 changes: 3 additions & 2 deletions Dockerfile.github-ci
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
FROM ptrxyz/chemotion:eln-1.5.0
FROM ptrxyz/internal:eln-1.8.0-rc4
ARG BRANCH=main
RUN apt-get install -y --no-install-recommends --autoremove --fix-missing \
build-essential\
openssh-server
openssh-server\
libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb

WORKDIR "/chemotion/app"

Expand Down
13 changes: 10 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ gem 'dotenv-rails', require: 'dotenv/rails-now'

gem 'ed25519'

gem 'faker', require: false
gem 'faraday'
gem 'faraday-follow_redirects'
gem 'faraday-multipart'
Expand Down Expand Up @@ -60,7 +61,10 @@ gem 'kaminari'
gem 'kaminari-grape'
gem 'ketcherails', git: 'https://github.com/complat/ketcher-rails.git', branch: 'upgrade-to-rails-6'

gem 'labimotion', '1.1.4'

gem 'mimemagic', '0.3.10'
gem 'mime-types'

# locked to enforce latest version of net-scp. without lock net-ssh would be updated first which locks
# out newer net-scp versions
Expand Down Expand Up @@ -88,9 +92,9 @@ gem 'pundit'

gem 'rack'
gem 'rack-cors', require: 'rack/cors'
gem 'rails', '~> 6.1.7.3'
gem 'rails', '~> 6.1.7.7'
gem 'rdkit_chem', git: 'https://github.com/ptrxyz/rdkit_chem.git', branch: 'pk01'
gem 'rinchi-gem', '1.0.1', git: 'https://git.scc.kit.edu/ComPlat/rinchi-gem.git'
gem 'rinchi-gem', '1.0.1', git: 'https://github.com/ComPlat/rinchi-gem.git'
gem 'rmagick'
gem 'roo'
gem 'rqrcode' # required for Barby to work but not listed as its dependency -_-
Expand All @@ -104,6 +108,8 @@ gem 'sassc-rails'
gem 'scenic'
gem 'schmooze'
gem 'semacode', git: 'https://github.com/toretore/semacode.git', branch: 'master' # required for Barby but not listed...

gem 'sentry-delayed_job'
gem 'sentry-rails'
gem 'sentry-ruby'
gem 'shrine', '~> 3.0'
Expand Down Expand Up @@ -186,12 +192,13 @@ group :test do
gem 'database_cleaner-active_record'

gem 'factory_bot_rails'
gem 'faker'

gem 'launchy'

gem 'rspec-repeat'

gem 'shoulda-matchers'

gem 'simplecov', require: false
gem 'simplecov-lcov', require: false

Expand Down
Loading

0 comments on commit 7346f79

Please sign in to comment.