This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-02-20
Channels
- # announcements (42)
- # babashka (70)
- # beginners (152)
- # chlorine-clover (19)
- # cider (14)
- # clj-kondo (23)
- # clojars (15)
- # clojure (86)
- # clojure-denmark (1)
- # clojure-dev (5)
- # clojure-europe (57)
- # clojure-france (145)
- # clojure-hungary (2)
- # clojure-italy (5)
- # clojure-nl (7)
- # clojure-spec (35)
- # clojure-sweden (2)
- # clojure-uk (58)
- # clojurebridge (1)
- # clojured (1)
- # clojurescript (50)
- # core-typed (9)
- # cursive (10)
- # data-science (11)
- # datascript (4)
- # datomic (25)
- # emacs (8)
- # fulcro (49)
- # graalvm (7)
- # graphql (6)
- # joker (1)
- # juxt (2)
- # kaocha (1)
- # off-topic (22)
- # other-lisps (1)
- # pathom (20)
- # re-frame (3)
- # reagent (11)
- # reitit (2)
- # remote-jobs (1)
- # shadow-cljs (44)
- # spacemacs (2)
- # sql (17)
- # tree-sitter (2)
- # vim (8)
- # vrac (2)
@marshall Thank you! I especially like the log list command. Would those commands also be available to call from a repl? That would be my prefered way of working. Then I don't need to have another window open, I can save some startup time, and I don't have to parse text to process the output further.
Turns out using it from the REPL works great
(require 'datomic.tools.ops)
(datomic.tools.ops.cloud/list-systems {})
(datomic.tools.ops.system/list-instances {:system "example"})
(datomic.tools.ops.log/events {:group "example"
:minutes-back 10
:tod (java.util.Date.)})
Someone else tried to deploy on-prem in AWS eu-north-1? I get an error Not a supported dynamodb region: eu-north-1 - (You'll never learn).
The included launch scripts dont currently support that region. You can likely provision and launch manually there. I will also look into adding support for the region in an upcoming release
In our case we get the error message when the peer is trying to connect, so this seems to go deeper than the launch script.
I believe I have a workaround that will work for you.
In your transactor properties file, change the protocol to ddb-local:
protocol=ddb-local
Then comment out the aws-dynamodb-region line:
#aws-dynamodb-region=
Finally, set the aws-dynamodb-override-endpoint to the address of the DDB endpoint:
aws-dynamodb-override-endpoint=
The use of ddb-local as the protocol will allow the system to honor the override configuration.
Similarly, you will need to use the ddb-local URI for your peer:
Thanks a lot! Right now we're moving things back to eu-central-1, but we might try this again later this week. Will let you know if we do and how we fare, if so.
That would certainly help us. We will probably stick with on-prem on AWS for a while, and we serve only Sweden.
Turns out using it from the REPL works great
(require 'datomic.tools.ops)
(datomic.tools.ops.cloud/list-systems {})
(datomic.tools.ops.system/list-instances {:system "example"})
(datomic.tools.ops.log/events {:group "example"
:minutes-back 10
:tod (java.util.Date.)})
When overriding the default table name in a metaschema, is that name then used to match with Datomic attributes and determine the columns for the associated table? (https://docs.datomic.com/cloud/analytics/analytics-metaschema.html#name-option)
just to follow up, the answer looks to be no. As in the name-opt
isn't used to match attributes whose munged namespace would match. Need to use :include
to capture them. (let me know if I'm missing something!)
I’m trying to automate my Ion deployments with a Github workflow, but I can’t figure out how to handle polling for the deployment status. I was wondering if anyone else has done this, or even with a different CI tool how you handled the polling.
I'm doing it on circle CI. This is my deploy function
;; Inspired by
(defn ions-release
"Do push and deploy of app. Supports stable and unstable releases. Returns when deploy finishes running."
[{:keys [group] :as args}]
(try
(let [push (requiring-resolve 'datomic.ion.dev/push)
deploy (requiring-resolve 'datomic.ion.dev/deploy)
deploy-status (requiring-resolve 'datomic.ion.dev/deploy-status)]
(println "Pushing" args)
(let [{:keys [dependency-conflicts deploy-groups] :as push-data} (push args)]
(assert (contains? (set deploy-groups) group) (str "Group " group " must be one of " deploy-groups))
(let [delay-between-retries 1000
deploy-args (merge (select-keys args [:creds-profile :region :uname :group])
(select-keys push-data [:rev]))
_ (println "Deploying" deploy-args)
deploy-data (deploy deploy-args)
deploy-status-args (merge (select-keys args [:creds-profile :region])
(select-keys deploy-data [:execution-arn]))]
(when dependency-conflicts
(clojure.pprint/pprint dependency-conflicts))
(println "Waiting for deploy" deploy-status-args)
(loop []
(let [status-data (deploy-status deploy-status-args)]
(if (= "RUNNING" (:code-deploy-status status-data))
(do
(print ".")
(flush)
(Thread/sleep delay-between-retries) (recur))
(do (println)
status-data)))))))
(catch Exception e
{:deploy-status "ERROR"
:message (.getMessage e)})))
I have an attribute that has a cardinality of many, how do I test in a query that all entries in it aren't equal to a certain thing?
I can do [?e :tags ?t] [(not= :tags [whatever])]
but that returns items that have the tag I don't want, because they also have other tags
I just realised not clauses were a thing, but that still doesn't completely solve the problem
If you are using on-prem, call a function that checks; this is very tedious in pure datalog
a pure datalog solution will be a variation of this: https://stackoverflow.com/questions/43784258/find-entities-whose-ref-to-many-attribute-contains-all-elements-of-input/43808266#43808266
An on-prem function implementation looks something like this:
(defn not-any-matching-eav? [db e a test-v]
(zero? (->> (datomic.api/datoms db :eavt e a test-v)
(bounded-count 1))))
is there any way with the pull syntax to indicate you only want the single value (v.s. a collection containing one value). With query we can do [:find ?x . :in ....]
is there something similar (only thing I could find in docs is ability to indicate limit). e.g. what about the case where you know there is only one term e.g. [:person/id [{:person/_child [:person/id]} :as :person/parent]]
and I do not want :person/parent
to be "boxed"? Like I would like the result to be [{:person/id :x :person/parent {:person/id :y}}]
not [{:person/id :x :person/parent [{:person/id :y}]}]
just to follow up, the answer looks to be no. As in the name-opt
isn't used to match attributes whose munged namespace would match. Need to use :include
to capture them. (let me know if I'm missing something!)
I’m thinking of using a tuple of two instants to represent a validity period, and a query would look something like [:find ?cap :in $ :where [?cap :capability/period ?period] [(ground (java.util.Date.)) ?now] [(first ?period) ?starts] [(second ?period) ?ends] [(< ?starts ?now)] [(< ?now ?ends)]]
. Is that an appropriate use of tuples? Is first
and second
the right way to pull those values out?