This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-12-05
Channels
- # adventofcode (246)
- # aleph (5)
- # aws (7)
- # beginners (161)
- # boot (3)
- # calva (42)
- # cider (40)
- # clara (10)
- # cljdoc (7)
- # cljs-dev (40)
- # cljsrn (6)
- # clojure (170)
- # clojure-dev (8)
- # clojure-greece (2)
- # clojure-italy (15)
- # clojure-kc (2)
- # clojure-new-zealand (13)
- # clojure-nl (13)
- # clojure-russia (3)
- # clojure-spec (5)
- # clojure-uk (160)
- # clojurescript (72)
- # clojurex (1)
- # cursive (7)
- # data-science (9)
- # datascript (1)
- # datomic (120)
- # devcards (4)
- # emacs (18)
- # figwheel-main (10)
- # fulcro (34)
- # kaocha (3)
- # luminus (1)
- # lumo (6)
- # music (1)
- # nrepl (23)
- # off-topic (2)
- # pedestal (4)
- # re-frame (42)
- # reagent (36)
- # reitit (10)
- # ring-swagger (21)
- # shadow-cljs (124)
- # spacemacs (6)
- # tools-deps (14)
- # unrepl (3)
- # vim (2)
I have a query that looks like this:
[:find (pull ?e [*])
:in $ [?veh ...]
:where
[?e :vehicle/plate ?veh]]
This returns one value, where multiple rows are squashed together into one map, which I don't understand.What I need is:
[{:vehicle/a "foo" :vehicle/b},
{:vehicle/a "more" :vehicle/b "other"}
]
maybe there were subtle changes when the client-api changed from datomic.client
to datomic.client.api
Could you paste the output you are seeing? Your first example is not valid clojure with the same :vehicle/a
key appearing multiple times in the same map
Hey there. Last night I was trying to stand up a pedestal service on IONS. I have been following: https://github.com/pedestal/pedestal-ions-sample However, when trying to deploy, as such:
clojure -Adev -m datomic.ion.dev '{:op :deploy, :group "ion-pet-Compute-1Q6752A2P837M", :uname "pet-service-sample"}'
{:execution-arn
arn:aws:states:us-east-2:272695641059:execution:datomic-ion-pet-Compute-1Q6752A2P837M:ion-pet-Compute-1Q6752A2P837M-pet-service-sample-1543987389875,
:status-command
"clojure -Adev -m datomic.ion.dev '{:op :deploy-status, :execution-arn arn:aws:states:us-east-2:272695641059:execution:datomic-ion-pet-Compute-1Q6752A2P837M:ion-pet-Compute-1Q6752A2P837M-pet-service-sample-1543987389875}'",
:doc
"To check the status of your deployment, issue the :status-command."}
I get the following
clojure -Adev -m datomic.ion.dev '{:op :deploy-status, :execution-arn arn:aws:states:us-east-2:272695641059:execution:datomic-ion-pet-Compute-1Q6752A2P837M:ion-pet-Compute-1Q6752A2P837M-pet-service-sample-1543987389875}'
{:deploy-status "FAILED", :code-deploy-status "FAILED"}
Looking at the logs it's clear that I have given the wrong :deployment-group:
2018-12-05T05:23:20.008Z 059ddc53-7801-4f4c-b688-60918314b781 DeploymentGroupDoesNotExistException: No Deployment Group found for name: ion-pet-Compute-1Q6752A2P837M
at Request.extractError (/var/runtime/node_modules/aws-sdk/lib/protocol/json.js:48:27)
at Request.callListeners (/var/runtime/node_modules/aws-sdk/lib/sequential_executor.js:105:20)
at Request.emit (/var/runtime/node_modules/aws-sdk/lib/sequential_executor.js:77:10)
at Request.emit (/var/runtime/node_modules/aws-sdk/lib/request.js:683:14)
at Request.transition (/var/runtime/node_modules/aws-sdk/lib/request.js:22:10)
at AcceptorStateMachine.runTo (/var/runtime/node_modules/aws-sdk/lib/state_machine.js:14:12)
at /var/runtime/node_modules/aws-sdk/lib/state_machine.js:26:10
at Request.<anonymous> (/var/runtime/node_modules/aws-sdk/lib/request.js:38:9)
at Request.<anonymous> (/var/runtime/node_modules/aws-sdk/lib/request.js:685:12)
at Request.callListeners (/var/runtime/node_modules/aws-sdk/lib/sequential_executor.js:115:18)
My question is where do I find that? I copied it direclty from the cloudformation name. Is that incorrect?Also, have you deployed the datomic cloud system correctly, but can you confirm it by connecting to that system before this push?
I believe I have deployed it correctly. I verified that by testing following the getting started
docs
When I deploy something I dont have quotes around the group.
clojure -Adev -m datomic.ion.dev '{:op :deploy, :group myproject-dev-compute, :rev "2fee444890ccf58d4629294f3904bf1c38bb762q"}'
Thanks for the input. My group needs to have the random identifier as such or it can't find the group as such ion-pet-Compute-1Q6752A2P837M
or it will not do anything
I still get the error: 2018-12-05T05:23:20.008Z 059ddc53-7801-4f4c-b688-60918314b781 DeploymentGroupDoesNotExistException: No Deployment Group found for name: ion-pet-Compute-1Q6752A2P837M
Can anyone tell me how to find my deployment group. THe docs are pretty bad around this. https://docs.datomic.com/cloud/ions/ions-reference.html#deploy
Being that there is no :deployment-group
I used $(SystemName)-Compute-$(GeneratedId)
but the docs suggest that that is for group
@petr to deploy you replace $(GROUP) with the name of your compute stack. are you sure the C is capitalized in “Compute”? You can see the name in the CF console https://console.aws.amazon.com/cloudformation/home?region=us-east-1#/stacks?filter=active
This is my last failed attempt:
clojure -Adev -m datomic.ion.dev '{:op :deploy, :rev "674e654d429ebc5092be8008b1463617720a1a7c", :uname "pet-service-sample", :group "ion-pet-Compute-1Q6752A2P837M", :region "us-east-2"}'
clojure -A:dev -m datomic.ion.dev '{:op :push :region "us-east-2" :uname "pet-service-sample"}'
Downloading: com/datomic/java-io/0.1.11/java-io-0.1.11.pom from
(cognitect.s3-libs.s3/upload "datomic-code-8fe8a54a-0daf-48b9-a4b8-bbdf996b81ae" [{:local-zip "target/datomic/apps/ion-pet-service/unrepro/pet-service-sample.zip", :s3-zip "datomic/apps/ion-pet-service/unrepro/pet-service-sample.zip"}] {:op :push, :profile "devthenet", :region "us-east-2", :uname "pet-service-sample"})
{:uname "pet-service-sample",
:region "us-east-2",
:deploy-groups (),
:dependency-conflicts
{:deps
{commons-codec/commons-codec #:mvn{:version "1.10"},
org.clojure/tools.analyzer.jvm #:mvn{:version "0.7.0"},
com.fasterxml.jackson.core/jackson-core #:mvn{:version "2.9.5"},
org.clojure/tools.reader #:mvn{:version "1.0.0-beta4"},
org.clojure/core.async #:mvn{:version "0.3.442"}},
:doc
"The :push operation overrode these dependencies to match versions already running in Datomic Cloud. To test locally, add these explicit deps to your deps.edn."},
:deploy-command
"clojure -Adev -m datomic.ion.dev '{:op :deploy, :group <group>, :uname \"pet-service-sample\", :region \"us-east-2\"}'",
:doc
"To deploy, issue the :deploy-command, replacing <group> with a group from :deploy-groups"}
clojure -Adev -m datomic.ion.dev '{:op :deploy, :rev "674e654d429ebc5092be8008b1463617720a1a7c", :uname "pet-service-sample", :group "ion-pet-Compute-1Q6752A2P837M", :region "us-east-2"}'
Is what I got when I took the deploy-command
and added the group{:allow [ion-sample.ion/app]
:lambdas {:app {:fn ion-sample.ion/app :description "Exploring Ions with Pedestal"}}
:app-name "ion-pet"}
So I realised that I hadn't committed that change. So I committed pushed and deployed. It's still failing, but this time cloudwatch doesnt' give anything useful
17:31:29
START RequestId: cdd511ba-86b4-4242-9abb-e587c536b404 Version: $LATEST
17:31:29
2018-12-05T17:31:29.248Z cdd511ba-86b4-4242-9abb-e587c536b404 { event: { codeDeploy: { deployment: [Object] }, lambda: { cI: 0, c: [Object], uI: -1, u: [], dI: -1, d: [], common: [Object] } } }
17:31:30
END RequestId: cdd511ba-86b4-4242-9abb-e587c536b404
17:31:30
REPORT RequestId: cdd511ba-86b4-4242-9abb-e587c536b404 Duration: 1271.95 ms Billed Duration: 1300 ms Memory Size: 128 MB Max Memory Used: 38 MB
No newer events found at the moment. Retry.
clojure -Adev -m datomic.ion.dev '{:op :deploy-status, :execution-arn arn:aws:states:us-east-2:272695641059:execution:datomic-ion-pet-Compute-1Q6752A2P837M:ion-pet-Compute-1Q6752A2P837M-pet-service-sample-1544031395342, :region "us-east-2"}'
{:deploy-status "FAILED", :code-deploy-status "FAILED"}
I think you’re on the right track though. This has to be a permissions/creds or region thing. I just tested on a new stack and my deploy command was populated with the compute stack as the $group
well, actually, did you provide an “application name” in your CFT when you launched?
you have a :rev and a :uname -> i dont think that would cause this, but i would expect you only to have one or the other
The example I was following specified one:
To push the project to your Datomic Cloud environment, execute the
following command from the root directory of the sample project:
`clojure -A:dev -m datomic.ion.dev '{:op :push :uname "pet-service-sample"}'`
We provide a `:uname` key because the sample has a `:local/root` dependency.
This command will return a map containing the key
`:deploy-command`. Copy the value and execute it at the command line
to deploy the ionized app. You will need to unescape the `:uname` value.
Could it be that the example code does not work and its' failing because it's unable to start the app?
So once I made i commited and pushed the change to ion-config.edn, the deployment group error went away
So do you think it's that https://github.com/pedestal/pedestal-ions-sample is just not compatible with the new cloud or there is just a mistake somewhere?
I think I'm going to try to redeploy with the exact name of the system used in the example (later today). I'll report back
am i right in thinking that not null
requirements on a standard sql column is a recipe for never being able to evolve your schema into the future? if i had foo varchar not null
and a year later we deprecate foo to instead use bar
, i dont want my application layer to have to carry the baggage of “filling in” old foos
as well as bars
?
i just want to leave the app code alone which deals with foos, and everything new uses bars instead.
is it more useful to have nothing marked not null
than* to pick and choose and in the future drop it?
In practice, I've seen a lot of Java code that has to check if every thing it touches is null. This comes from not having a coherent idea throughout the system of what null means (error? not yet filled in?). This is wasteful and super painful. The "not null" constraint on fields might be useful to communicate to other devs, who cannot push code which violates contracts. That said, there are other ways to validate contracts, and which is best depends on the domain.
And if you don't have other developers, it's moot. Unless you have an old, dodgy brain like me.
Datomic (and Clojure) strongly embrace the idea that you should say things that you know and omit things that you don’t
so, I do not think it is silly
i just watched rich’s last talk “maybe not” and was trying to apply it to this case where i dont have datomic but want datomic in postgres
but as with anything, it depends :)
if you don’t know, then why say anything at all? :)
well, i guess to be more clear (arghh the english language): i like the idea of nil meaning “look person, i dont even know what you’re talking about…“, which currently cant be represented in postgres (unlike datomic where you can simply omit something). and maybe the best way to do that is simply nil the field
You could always make one Postgres table called "facts" with "e" "a" and "v" columns .... (jk, don't do this)
between triggers, log tables, and a reified transactions table with some cleverness we’re getting close to about 25% of the power of datomic
@lwhorton: Anecdotally, I've worked with systems that blow up hard if there's a null in the wrong place - particularly where it is either a vendor database and so I can't change anything, or if there are legacy or external systems that I'm integrating one of my databases with. I'm seriously considering stripping out nulls as part of my JDBC queries as a step towards migrating to Datomic and to make the Clojure code a little more consistent (though this may be a terrible idea).
thanks for the insight @shaun-mahood. i’m working in an elixir system and also very much considering modifying the db connector to auto-strip nulls too. as alex said, if we dont know it why bother even declaring we dont know it.