Skip to content

Commit

Permalink
refactored all module installer
Browse files Browse the repository at this point in the history
  • Loading branch information
jlangch committed Mar 23, 2024
1 parent 371bf39 commit f443b69
Show file tree
Hide file tree
Showing 9 changed files with 86 additions and 47 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public static boolean isValidModule(final VncKeyword module) {
"excel-install",
"ivy-install",
"jansi-install",
"langchain-install",
"pdf-install",
"qrbill-install",
"tomcat-install",
Expand Down Expand Up @@ -89,6 +90,7 @@ public static boolean isValidModule(final VncKeyword module) {
"java",
"jsonl",
"kira",
"langchain",
"math",
"matrix",
"maven",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
(load-module :installer)



;; https://www.bouncycastle.org/latest_releases.html#LATEST
(defn libraries []
[ "org.bouncycastle:bcprov-jdk18on:1.77"
Expand All @@ -43,6 +44,7 @@
"org.bouncycastle:bctls-jdk18on:1.77"
"org.bouncycastle:bcpg-jdk18on:1.77" ] )


(defn
^{ :arglists '("(install options*)")
:doc
Expand All @@ -64,5 +66,5 @@

install [ & options]

(apply installer/install-libs (libraries) options))
(apply installer/install (libraries) options))

Original file line number Diff line number Diff line change
Expand Up @@ -41,30 +41,7 @@
(defn libraries []
[ "com.theokanning.openai-gpt3-java:api:0.18.2"
"com.theokanning.openai-gpt3-java:client:0.18.2"
"com.theokanning.openai-gpt3-java:service:0.18.2"

"com.knuddels:jtokkit:0.6.1"

"com.squareup.retrofit2:adapter-rxjava2:2.9.0"
"com.squareup.retrofit2:retrofit:2.9.0"
"com.squareup.retrofit2:converter-jackson:2.9.0"
"com.squareup.okhttp3:okhttp:3.14.9"
"com.squareup.okio:okio:1.17.2"

"com.kjetland:mbknor-jackson-jsonschema_2.12:1.0.39"

"com.fasterxml.jackson.core:jackson-annotations:2.14.2"
"com.fasterxml.jackson.core:jackson-databind:2.14.2"
"com.fasterxml.jackson.core:jackson-core:2.14.2"

"io.reactivex.rxjava2:rxjava:2.0.0"

"javax.validation:validation-api:2.0.1.Final"

"org.reactivestreams:reactive-streams:1.0.3"
"org.scala-lang:scala-library:2.12.18" ;; we might not need this lib
"org.slf4j:slf4j-api:2.0.10"
])
"com.theokanning.openai-gpt3-java:service:0.18.2" ])


(defn
Expand All @@ -88,4 +65,4 @@

install [ & options]

(apply installer/install-libs (libraries) options))
(apply installer/install (libraries) options))
26 changes: 7 additions & 19 deletions src/main/resources/com/github/jlangch/venice/excel-install.venice
Original file line number Diff line number Diff line change
Expand Up @@ -34,29 +34,17 @@
(load-module :installer)


(defn libraries []
(defn libraries-5.x []
[ "org.apache.poi:poi:5.2.3"
"org.apache.poi:poi-ooxml:5.2.3"
"org.apache.poi:poi-ooxml-full:5.2.3"
"org.apache.commons:commons-collections4:4.4"
"org.apache.commons:commons-compress:1.21"
"org.apache.commons:commons-math3:3.6.1"
"org.apache.xmlbeans:xmlbeans:5.1.1"
"commons-codec:commons-codec:1.15"
"commons-io:commons-io:2.11.0"
"org.apache.logging.log4j:log4j-api:2.19.0"
"org.apache.logging.log4j:log4j-core:2.19.0" ] )
"org.apache.logging.log4j:log4j-api:2.20.0"
"org.apache.logging.log4j:log4j-core:2.20.0" ] )

(defn libraries-4.x []
[ "org.apache.poi:poi:4.1.2"
"org.apache.poi:ooxml:4.1.2"
"org.apache.poi:ooxml-schemas:4.1.2"
"org.apache.commons:commons-collections4:4.4"
"org.apache.commons:commons-compress:1.20"
"org.apache.commons:commons-math3:3.6.1"
"org.apache.xmlbeans:xmlbeans:3.1.0"
"commons-codec:commons-codec:1.15"
"commons-io:commons-io:2.11.0" ] )
"org.apache.poi:poi-ooxml:4.1.2"
"org.apache.poi:poi-ooxml-schemas:4.1.2" ] )


(defn
Expand All @@ -80,7 +68,7 @@

install [ & options]

(apply installer/install-libs (libraries) options))
(apply installer/install (libraries-5.x) options))


(defn
Expand All @@ -106,4 +94,4 @@

install-4.x [ & options]

(apply installer/install-libs (libraries-4.x) options))
(apply installer/install (libraries-4.x) options))
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
;;;; __ __ _
;;;; \ \ / /__ _ __ (_) ___ ___
;;;; \ \/ / _ \ '_ \| |/ __/ _ \
;;;; \ / __/ | | | | (_| __/
;;;; \/ \___|_| |_|_|\___\___|
;;;;
;;;;
;;;; Copyright 2017-2024 Venice
;;;;
;;;; Licensed under the Apache License, Version 2.0 (the "License");
;;;; you may not use this file except in compliance with the License.
;;;; You may obtain a copy of the License at
;;;;
;;;; http://www.apache.org/licenses/LICENSE-2.0
;;;;
;;;; Unless required by applicable law or agreed to in writing, software
;;;; distributed under the License is distributed on an "AS IS" BASIS,
;;;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
;;;; See the License for the specific language governing permissions and
;;;; limitations under the License.


;;;; Install LangChain4J 3rd party libraries:
;;;;
;;;; (load-module :langchain-install)
;;;; (langchain-install/install :dir (repl/libs-dir) :silent false)
;;;;
;;;; Note: This not a package manager. The module provides functions to
;;;; download Java libraries to a directory.


(ns langchain-install)

(load-module :installer)


(defn libraries []
[ "dev.langchain4j:langchain4j:0.28.0"
"dev.langchain4j:langchain4j-open-ai:0.28.0"
"dev.langchain4j:langchain4j-hugging-face:0.28.0"
"dev.langchain4j:langchain4j-qdrant:0.28.0"] )


(defn
^{ :arglists '("(install options*)")
:doc
"""
Install the Java 3rd party libraries for the BouncyCastle module.

Options:

| :dir path | download dir, defaults to "." |
| :silent {true,false} | if silent is true does not show a progress \
bar, defaults to true |
"""
:examples '(
"""
(do
(load-module :langchain-install)
(langchain-install/install :dir (repl/libs-dir) :silent false))
""") }

install [ & options]

(apply installer/install (libraries) options))

Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"org.apache.pdfbox:fontbox:3.0.1"
"org.slf4j:slf4j-api:2.0.10"])


(defn
^{ :arglists '("(install options*)")
:doc
Expand All @@ -70,4 +71,5 @@
(load-module :xchart-install)
(apply xchart-install/install options)

;; no dependency reolving, just install the listed libs
(apply installer/install-libs (libraries) options))
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,5 @@
(load-module :bouncycastle-install)
(apply bouncycastle-install/install options)

;; no dependency reolving, just install the listed libs
(apply installer/install-libs (libraries) options))
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
(if (= 8 (java-major-version))
[ "org.apache.tomcat.embed:tomcat-embed-core:10.0.27"
"jakarta.annotation:jakarta.annotation-api:2.1.1" ]
[ "org.apache.tomcat.embed:tomcat-embed-core:10.1.17"
[ "org.apache.tomcat.embed:tomcat-embed-core:10.1.19"
"jakarta.annotation:jakarta.annotation-api:2.1.1" ]))


Expand All @@ -65,4 +65,4 @@

install [ & options]

(apply installer/install-libs (libraries) options))
(apply installer/install (libraries) options))
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,5 @@

install [ & options]

;; no dependency reolving, just install the xchart lib
(apply installer/install-libs (libraries) options))

0 comments on commit f443b69

Please sign in to comment.