Repository: accelerated-text/accelerated-text (language: python)

Issue:
Issue with JAVA_HOME in Clojure docker images
Location of `JAVA_HOME` was changed in `clojure:tools-deps-alpine` image to `/opt/java/openjdk`, but we mount a volume with resources on `/opt` and this makes java unreachable.


Discussion / hints:

Fix patch:
diff --git a/api/Dockerfile b/api/Dockerfile
index 94e139ce6..9cce43cb7 100644
--- a/api/Dockerfile
+++ b/api/Dockerfile
@@ -6,9 +6,9 @@ WORKDIR /usr/src/app
 COPY ./core/deps.edn /usr/src/core/
 COPY ./api/deps.edn /usr/src/app/
 
-RUN clojure -R:test || true
+RUN clojure -X:deps prep
 
 COPY ./api /usr/src/app
 COPY ./core /usr/src/core
 
-CMD ["clojure", "-m", "api.server"]
\ No newline at end of file
+CMD ["clojure", "-m", "api.server"]
diff --git a/api/deps.edn b/api/deps.edn
index 7d87f169e..9c4d994df 100644
--- a/api/deps.edn
+++ b/api/deps.edn
@@ -1,22 +1,24 @@
 {:deps      {accelerated-text/core                {:local/root "../core"}
-             ch.qos.logback/logback-classic       {:mvn/version "1.2.3"}
-             com.walmartlabs/lacinia              {:mvn/version "0.38.0"}
-             http-kit/http-kit                    {:mvn/version "2.3.0"}
+             ch.qos.logback/logback-classic       {:mvn/version "1.4.5"}
+             com.walmartlabs/lacinia              {:mvn/version "1.1"}
+             io.aviso/pretty                      {:mvn/version "1.3"}
+             http-kit/http-kit                    {:mvn/version "2.6.0"}
              javax.servlet/servlet-api            {:mvn/version "2.5"}
-             ring/ring-core                       {:mvn/version "1.7.1"}
-             net.sf.extjwnl/extjwnl               {:mvn/version "2.0.2"}
+             ring/ring-core                       {:mvn/version "1.9.6"}
+             net.sf.extjwnl/extjwnl               {:mvn/version "2.0.5"}
              net.sf.extjwnl/extjwnl-data-wn31     {:mvn/version "1.2"}
-             metosin/jsonista                     {:mvn/version "0.2.5"}
-             metosin/reitit                       {:mvn/version "0.5.12"}
-             mount/mount                          {:mvn/version "0.1.16"}
+             metosin/jsonista                     {:mvn/version "0.3.7"}
+             metosin/reitit                       {:mvn/version "0.5.18"}
+             mount/mount                          {:mvn/version "0.1.17"}
              com.datomic/datomic-free             {:mvn/version "0.9.5697"
                                                    :exclusions  [org.slf4j/slf4j-nop org.slf4j/slf4j-log4j12]}
-             io.rkn/conformity                    {:mvn/version "0.5.1"}
-             org.clojure/clojure                  {:mvn/version "1.10.1"}
-             org.clojure/data.csv                 {:mvn/version "0.1.4"}
-             org.clojure/tools.logging            {:mvn/version "0.5.0"}
+             io.rkn/conformity                    {:mvn/version "0.5.4"}
+             org.clojure/clojure                  {:mvn/version "1.11.1"}
+             org.clojure/data.csv                 {:mvn/version "1.0.1"}
+             org.clojure/data.xml                 {:mvn/version "0.2.0-alpha6"}
+             org.clojure/tools.logging            {:mvn/version "1.2.4"}
              ai.tokenmill.numberwords/numberwords {:mvn/version "1.1.0"}
-             dk.ative/docjure                     {:mvn/version "1.14.0"}
+             dk.ative/docjure                     {:mvn/version "1.19.0"}
              commons-codec/commons-codec          {:mvn/version "1.15"}}
  :paths     ["src" "resources"]
  :mvn/repos {"central" {:url "https://repo1.maven.org/maven2/"}
@@ -27,11 +29,11 @@
                                                                  :sha     "028a6d41ac9ac5d5c405dfc38e4da6b4cc1255d5"}}
                         :main-opts   ["-m" "cognitect.test-runner"]}
              :coverage {:extra-paths ["test"]
-                        :extra-deps  {cloverage/cloverage {:mvn/version "1.2.2"}}
+                        :extra-deps  {cloverage/cloverage {:mvn/version "1.2.3"}}
                         :main-opts   ["-m" "cloverage.coverage" "-p" "src" "-s" "test" "--codecov" "--runner" "clojure.test"]}
              :lint     {:extra-paths ["test"]
-                        :extra-deps  {clj-kondo/clj-kondo {:mvn/version "RELEASE"}}
+                        :extra-deps  {clj-kondo/clj-kondo {:mvn/version "2022.12.10"}}
                         :main-opts   ["-m" "clj-kondo.main" "--lint" "src" "test"]}
              :format   {:extra-paths ["test"]
-                        :extra-deps  {cljfmt/cljfmt {:mvn/version "0.8.0"}}
+                        :extra-deps  {cljfmt/cljfmt {:mvn/version "0.9.0"}}
                         :main-opts   ["-m" "cljfmt.main"]}}}
diff --git a/api/src/api/nlg/parser.clj b/api/src/api/nlg/parser.clj
index df3b6daa4..d9cce0420 100644
--- a/api/src/api/nlg/parser.clj
+++ b/api/src/api/nlg/parser.clj
@@ -416,7 +416,7 @@
            (zip/edit post-add-kind context)
            (dp-zip/post-next))))))
 
-(defn add-category [semantic-graph {:keys [id kind name] :as node} {variables :variables}]
+(defn add-category [semantic-graph {:keys [id kind type name] :as node} {variables :variables}]
   (let [in-relations (filter #(= (:to %) id) (::sg/relations semantic-graph))
         kind         (or
                       kind
diff --git a/azure-pipelines.yml b/azure-pipelines.yml
index 93000e4c6..f721446c0 100644
--- a/azure-pipelines.yml
+++ b/azure-pipelines.yml
@@ -7,7 +7,7 @@ pr:
 jobs:
   - job: unit_test_backend
     pool:
-      vmImage: 'ubuntu-latest'
+      vmImage: 'ubuntu-20.04'
     steps:
       - script: |
           curl -O https://download.clojure.org/install/linux-install-1.10.1.492.sh
@@ -24,7 +24,7 @@ jobs:
 
   - job: lint_backend
     pool:
-      vmImage: 'ubuntu-latest'
+      vmImage: 'ubuntu-20.04'
     steps:
       - script: |
           curl -O https://download.clojure.org/install/linux-install-1.10.1.492.sh
@@ -48,7 +48,7 @@ jobs:
   - job: check_format
     continueOnError: true
     pool:
-      vmImage: 'ubuntu-latest'
+      vmImage: 'ubuntu-20.04'
     steps:
       - script: |
           curl -O https://download.clojure.org/install/linux-install-1.10.1.492.sh
@@ -68,7 +68,7 @@ jobs:
 # TODO: fix test timeout
 # - job: test_frontend
 #   pool:
-#     vmImage: 'ubuntu-latest'
+#     vmImage: 'ubuntu-20.04'
 #   steps:
 #     - task: NodeTool@0
 #       inputs:
@@ -79,7 +79,7 @@ jobs:
       
   - job: api_integration_tests
     pool:
-      vmImage: 'ubuntu-latest'
+      vmImage: 'ubuntu-20.04'
     dependsOn:
       - unit_test_backend
     steps:
@@ -109,7 +109,7 @@ jobs:
 
   - job: core_integration_tests
     pool:
-      vmImage: 'ubuntu-latest'
+      vmImage: 'ubuntu-20.04'
     dependsOn:
       - unit_test_backend
     steps:
@@ -138,7 +138,7 @@ jobs:
 
   - job: eval
     pool:
-      vmImage: 'ubuntu-latest'
+      vmImage: 'ubuntu-20.04'
     steps:
       - checkout: self
         submodules: true
@@ -167,7 +167,7 @@ jobs:
       - eval
     condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
     pool:
-      vmImage: 'ubuntu-latest'
+      vmImage: 'ubuntu-20.04'
     variables:
       DOCKER_BUILDKIT: 1
     steps:
diff --git a/core/Dockerfile b/core/Dockerfile
index 6a7aa4302..ceef45809 100644
--- a/core/Dockerfile
+++ b/core/Dockerfile
@@ -4,6 +4,6 @@ RUN mkdir /root/.gitlibs
 
 WORKDIR /usr/src/app
 COPY deps.edn ./
-RUN clojure -R:test || true
+RUN clojure -X:deps prep
 
 COPY . ./
diff --git a/core/deps.edn b/core/deps.edn
index 5fc1bd125..cca36112f 100644
--- a/core/deps.edn
+++ b/core/deps.edn
@@ -1,28 +1,25 @@
 {:paths     ["resources" "src" "test"]
- :deps      {org.clojure/clojure            {:mvn/version "1.10.1"}
-             org.clojure/tools.logging      {:mvn/version "0.4.1"}
-             ch.qos.logback/logback-classic {:mvn/version "1.2.3"}
-             jdom/jdom                      {:mvn/version "1.0"}
-             metosin/jsonista               {:mvn/version "0.2.5"}
-             http-kit/http-kit              {:mvn/version "2.3.0"}
-             trove/trove                    {:mvn/version "1.1-beta-5"}
-             org.clojure/data.xml           {:mvn/version "0.2.0-alpha6"}
+ :deps      {org.clojure/clojure            {:mvn/version "1.11.1"}
+             org.clojure/tools.logging      {:mvn/version "1.2.4"}
+             ch.qos.logback/logback-classic {:mvn/version "1.4.5"}
+             metosin/jsonista               {:mvn/version "0.3.7"}
+             http-kit/http-kit              {:mvn/version "2.6.0"}
              org.clojure/math.combinatorics {:mvn/version "0.1.6"}
-             ubergraph/ubergraph            {:mvn/version "0.8.1"}}
+             ubergraph/ubergraph            {:mvn/version "0.8.2"}}
  :mvn/repos {"central" {:url "https://repo1.maven.org/maven2/"}
              "clojars" {:url "https://clojars.org/repo"}}
- :aliases   {:dev      {:extra-deps {org.clojure/test.check {:mvn/version "0.9.0"}}}
+ :aliases   {:dev      {:extra-deps {org.clojure/test.check {:mvn/version "1.1.1"}}}
              :test     {:extra-paths ["test"]
                         :extra-deps  {com.cognitect/test-runner
                                       {:git/url "https://github.com/cognitect-labs/test-runner"
                                        :sha     "028a6d41ac9ac5d5c405dfc38e4da6b4cc1255d5"}}
                         :main-opts   ["-m" "cognitect.test-runner"]}
              :coverage {:extra-paths ["test"]
-                        :extra-deps  {cloverage/cloverage {:mvn/version "1.2.2"}}
+                        :extra-deps  {cloverage/cloverage {:mvn/version "1.2.3"}}
                         :main-opts   ["-m" "cloverage.coverage" "-p" "src" "-s" "test" "--codecov" "--runner" "clojure.test"]}
              :lint     {:extra-paths ["test"]
-                        :extra-deps  {clj-kondo/clj-kondo {:mvn/version "RELEASE"}}
+                        :extra-deps  {clj-kondo/clj-kondo {:mvn/version "2022.12.10"}}
                         :main-opts   ["-m" "clj-kondo.main" "--lint" "src" "test"]}
              :format   {:extra-paths ["test"]
-                        :extra-deps  {cljfmt/cljfmt {:mvn/version "0.8.0"}}
+                        :extra-deps  {cljfmt/cljfmt {:mvn/version "0.9.0"}}
                         :main-opts   ["-m" "cljfmt.main"]}}}
diff --git a/docker-compose.yml b/docker-compose.yml
index 603f02715..9d018023b 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -16,14 +16,14 @@ services:
       ENABLE_REF_EXPR: "FALSE"
       DB_IMPLEMENTATION: "datomic"
       DB_URI: "datomic:free://datomic-transactor:4334/acc-text?password=datomic"
-      CONFIG_PATH: "/opt/config"
-      DATA_FILES: "/opt/data-files"
-      DICT_PATH: "/opt/dictionary"
-      DOCUMENT_PLANS: "/opt/document-plans"
+      CONFIG_PATH: "/opt/acctext/config"
+      DATA_FILES: "/opt/acctext/data-files"
+      DICT_PATH: "/opt/acctext/dictionary"
+      DOCUMENT_PLANS: "/opt/acctext/document-plans"
       ENABLED_LANGUAGES: "Eng"
       ENABLED_READERS: ""
     volumes:
-      - ./api/resources:/opt
+      - ./api/resources:/opt/acctext
     depends_on:
       - datomic-transactor
       - gf


Test patch:
diff --git a/api/docker-compose.test.yml b/api/docker-compose.test.yml
index f6817bdd4..54f686923 100644
--- a/api/docker-compose.test.yml
+++ b/api/docker-compose.test.yml
@@ -11,17 +11,17 @@ services:
       ENABLE_ENRICH: "FALSE"
       ENABLE_REF_EXPR: "FALSE"
       DB_IMPLEMENTATION: "datomic"
-      DATA_FILES: "/opt/data-files"
-      DICT_PATH: "/opt/dictionary"
-      DOCUMENT_PLANS: "/opt/document-plans"
-    command: ["clojure", "-A:dev:coverage", "--output", "/opt/coverage"]
+      DATA_FILES: "/opt/acctext/data-files"
+      DICT_PATH: "/opt/acctext/dictionary"
+      DOCUMENT_PLANS: "/opt/acctext/document-plans"
+    command: ["clojure", "-A:dev:coverage", "--output", "/opt/acctext/coverage"]
     volumes:
-      - ./resources/schema.graphql:/opt/schema.graphql
-      - ./resources/datomic-schema:/opt/datomic-schema
-      - ./test/resources/data-files:/opt/data-files
-      - ./test/resources/dictionary:/opt/dictionary
-      - ./test/resources/document-plans:/opt/document-plans
-      - ./.stats/coverage/api:/opt/coverage
+      - ./resources/schema.graphql:/opt/acctext/schema.graphql
+      - ./resources/datomic-schema:/opt/acctext/datomic-schema
+      - ./test/resources/data-files:/opt/acctext/data-files
+      - ./test/resources/dictionary:/opt/acctext/dictionary
+      - ./test/resources/document-plans:/opt/acctext/document-plans
+      - ./.stats/coverage/api:/opt/acctext/coverage
   gf:
     image: acctext/core:test
     build:
diff --git a/core/docker-compose.test.yml b/core/docker-compose.test.yml
index 6a7a8ffae..ad185d5c7 100644
--- a/core/docker-compose.test.yml
+++ b/core/docker-compose.test.yml
@@ -7,9 +7,9 @@ services:
       context: .
     environment:
       GF_ENDPOINT: http://gf:8000
-    command: ["clojure", "-A:dev:coverage", "--output", "/opt/coverage"]
+    command: ["clojure", "-A:dev:coverage", "--output", "/opt/acctext/coverage"]
     volumes:
-      - ./.stats/coverage/core:/opt/coverage
+      - ./.stats/coverage/core:/opt/acctext/coverage
   gf:
     image: acctext/gf:test
     build: