Fork me on GitHub
#datomic
<
2019-10-09
>
MegaMatt12:10:51

has anyone had trouble deploying to cloud on ValidateService? the state machine times out on Deployment Complete? for me. Never get the lambda created.

dmarjenburgh12:10:33

Cases where this can happen include having an error on program startup. For example, when there’s a syntax error or missing dependency. Try running the code with the deps it has in the cloud. (You can’t push code under alias paths I believe )

MegaMatt12:10:08

thanks @U05469DKJ. can you elaborate a little? how do i use the cloud deps to run locally?

MegaMatt12:10:51

what do you mean that I cannot push code under alias paths? does that mean when i push i shouldn’t include -Adev?

dmarjenburgh12:10:46

Yeah, the bundled code doesn’t include :extra-deps or code under :extra-paths in the dev alias. You can use a dev alias to include ion-dev for push and deploy commands, but the deployed code shouldn’t depend on stuff in :extra-deps/:extra-paths. Try running just clj (no alias) and loading the namespace(s) where your ion handlers live and see if it throws an error or not.

dmarjenburgh12:10:51

The datomic-client-cloud dependency does not have to be in your deployed deps, since this is one is provided

MegaMatt12:10:06

i don’t have a problem from the repl loading my namespace file • (load-file “/src/datomic-card/core.clj”) • (in-ns ’datomic-card.core) • (hello-world)

MegaMatt12:10:30

deps file

{:paths ["src" "resources"]
 :deps {com.datomic/ion {:mvn/version "0.9.35"}
        org.clojure/data.json {:mvn/version "0.2.6"}
        org.clojure/clojure {:mvn/version "1.10.0"}}

 :mvn/repos {"datomic-cloud" {:url ""}}
 :aliases
 {:dev {:extra-deps {com.datomic/client-cloud {:mvn/version "0.8.78"}
                     com.datomic/ion-dev {:mvn/version "0.9.234"}}}}}

MegaMatt12:10:28

ah, this always gets me when i come back to clojure. my folder is named like my namespace datomic-card changing to underscore fixes the issue. Thank you!

😅 8
kelveden12:10:26

I've been trying (but failed so far) to find some definitive documentation on what facilities are available for backup/restore in Datomic Cloud. Does anyone know of any?

kelveden12:10:08

Or is it a matter of dealing with the underlying storage in the cloud (i.e. backup the S3 bucket)?

favila14:10:31

cloud does not have backup/restore like on-prem.

favila14:10:53

I suspect this problem will be solved in the same time and way as an on-prem<->cloud migration solution

favila14:10:38

if they consider s3 to be durable enough not to need backup, then the only other use cases are moving to a different cloud installation (workaround: copy all s3 entries while the cluster is off) or to a different storage altogether (i.e. an on-prem migration) or restoring an older point-in-time

kelveden15:10:23

Thanks @U09R86PA4, that makes sense. It'd certainly be nice to have an explicit restoration process but working with just what's currently available is possible. The service I'm working on currently is just used during normal work hours (in one time zone) which means that there could be the flexibility for switching off overnight to execute a backup.

Msr Tim15:10:20

Hi is there documentation somewhere that has some guidance of setting up different enviroments for a project. Do I have spin up seperate prod clusters for each enviroment.

dmarjenburgh15:10:54

You can’t/shouldn’t have separate ion-config per environment. But each compute-stack/application can have it’s own env map (parameter in the CFT). There’s also integration with the aws parameter store

Msr Tim15:10:07

thank you. I will take a look.

Msr Tim15:10:25

I haven't really looked at ions that much. Only cloud hosted datomic.

m0smith16:10:13

I see the docs refer to a :schema/see-instead for deprecating an attribute. When I try and use it, it gives me an error datomic.impl.Exceptions$IllegalArgumentExceptionInfo: :db.error/not-an-entity Unable to resolve entity: :schema/see-instead {:entity :schema/see-instead, :db/error :db.error/not-an-entity} any ideas?

favila16:10:00

This is a hypothetical attribute you create for schema management, not a builtin

m0smith17:10:58

Is there an example of what it should look like?

favila17:10:27

Looks like a cardinality-one ref-type attr

favila17:10:12

{:db/ident :schema/see-instead :db/cardinality :db.cardinality/one :db/valueType :db.type/ref} is how I would do it

favila17:10:49

but this is just an example, you can do anything you want

favila17:10:12

the larger point is put metadata on your attributes

favila17:10:34

bonus if they’re machine-readable, then you can do things like e.g. generate deprecation lists

m0smith21:10:47

Thanks, that helps a lot

xiongtx22:10:21

I've found some strange behavior in datomic 0.9.5951 query: This works fine:

(d/q '[:find ?e
       :in $ ?uid
       :where [?e :other/id ?uid]]
     (d/db conn) [:user/id user-id])
This throws IllegalArgumentException: Cannot resolve key: [:user/id ?uid]
(d/q '[:find ?e
       :in $ ?uid
       :where [?e :other/id [:user/id ?uid]]]
     (d/db conn) user-id)
Is this expected behavior or...?