<commit_before>; Licensed to the Apache Software Foundation (ASF) under one
; or more contributor license agreements. See the NOTICE file
; distributed with this work for additional information
; regarding copyright ownership. The ASF licenses this file
; to you 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.
(ns dda.pallet.dda-user-crate.app.instantiate-aws
  (:require
    [clojure.inspector :as inspector]
    [org.domaindrivenarchitecture.pallet.commons.session-tools :as session-tools]
    [org.domaindrivenarchitecture.pallet.commons.pallet-schema :as ps]
    [dda.cm.operation :as operation]
    [dda.cm.aws :as cloud-target]
    [dda.pallet.dda-user-crate.infra.user.os-user :as os-user]
    [dda.pallet.dda-user-crate.app :as app]))

(def shantanu-key
  {:type "ssh-rsa"
   :public-key "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDY96t89DVhJsCw1yulH1fi6YUiguAc2a6nKCXwvo+IxP/JZyq5j2zM+j84Sj9vdGcRnpeFDW/OhiNIA1gxmgvWnCbm3AI6uoLF08bWXCWaGpcQIANpuIWyh2oQhHD+3twaL8jPZXHZvBWNYxlXY+z1JSpSJ2r8JHebwe4mcypCWtXCkoBw4+/j4iU3ksPpFhJFRY1ij1bWEFnUSYhMWNCIvps4OPz9tLKRDjBd7rWYSSia04AuFjRgMHiZ79rY+brxQSVj4a0fnppomfe9QOsGzl0LlQMAea7ahOxFOtuenngyHA56U2kv5Fhu71ZBtEikIJpY6S6TNJEhiITfvEdB"
   :comment "<EMAIL>"})

(def jem-key-host
 {:type "ssh-rsa"
  :public-key "<KEY>
  :comment "mje@host"})

(def jem-key-vm
 {:type "ssh-rsa"
  :public-key "<KEY>"
  :comment "mje@jergerProject"})

(def ssh-pub-key
  (os-user/read-ssh-pub-key-to-config))

(def ssh-priv-key "$YOUR_PRIVATE_KEY")

(def ssh-key-pair
  {:public-key ssh-pub-key
   :private-key ssh-priv-key})

(def domain-config
  {:jem {:encrypted-password "<PASSWORD>"
         :authorized-keys [jem-key-host jem-key-vm]}
   :shantanu {:encrypted-password "<PASSWORD>"
              :authorized-keys [shantanu-key]}
   :test {:encrypted-password  "<PASSWORD>"
          :authorized-keys [ssh-pub-key]
          :personal-key ssh-key-pair}})

(defn provisioning-spec [count]
  (merge
    (app/dda-user-group (app/app-configuration domain-config))
    (cloud-target/node-spec "jem")
    {:count count}))

(defn converge-install
  ([count]
   (operation/do-converge-install (cloud-target/provider) (provisioning-spec count)))
  ([key-id key-passphrase count]
   (operation/do-converge-install (cloud-target/provider key-id key-passphrase) (provisioning-spec count))))

(defn server-test
  ([count]
   (operation/do-server-test (cloud-target/provider) (provisioning-spec count)))
  ([key-id key-passphrase count]
   (operation/do-server-test (cloud-target/provider key-id key-passphrase) (provisioning-spec count))))
<commit_msg>adjust to updated dda-pallet-commons<commit_after>; Licensed to the Apache Software Foundation (ASF) under one
; or more contributor license agreements. See the NOTICE file
; distributed with this work for additional information
; regarding copyright ownership. The ASF licenses this file
; to you 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.
(ns dda.pallet.dda-user-crate.app.instantiate-aws
  (:require
    [clojure.inspector :as inspector]
    [dda.pallet.commons.session-tools :as session-tools]
    [dda.pallet.commons.pallet-schema :as ps]
    [dda.cm.operation :as operation]
    [dda.cm.aws :as cloud-target]
    [dda.pallet.dda-user-crate.infra.user.os-user :as os-user]
    [dda.pallet.dda-user-crate.app :as app]))

(def shantanu-key
  {:type "ssh-rsa"
   :public-key "ssh-rsa <KEY>"
   :comment "<EMAIL>"})

(def jem-key-host
 {:type "ssh-rsa"
  :public-key "<KEY>
  :comment "mje@host"})

(def jem-key-vm
 {:type "ssh-rsa"
  :public-key "<KEY>"
  :comment "mje@jergerProject"})

(def ssh-pub-key
  (os-user/read-ssh-pub-key-to-config))

(def ssh-priv-key "$YOUR_PRIVATE_KEY")

(def ssh-key-pair
  {:public-key ssh-pub-key
   :private-key ssh-priv-key})

(def domain-config
  {:jem {:encrypted-password "<PASSWORD>"
         :authorized-keys [jem-key-host jem-key-vm]}
   :shantanu {:encrypted-password "<PASSWORD>"
              :authorized-keys [shantanu-key]}
   :test {:encrypted-password  "<PASSWORD>"
          :authorized-keys [ssh-pub-key]
          :personal-key ssh-key-pair}})

(defn provisioning-spec [count]
  (merge
    (app/dda-user-group (app/app-configuration domain-config))
    (cloud-target/node-spec "jem")
    {:count count}))

(defn converge-install
  ([count]
   (operation/do-converge-install (cloud-target/provider) (provisioning-spec count)))
  ([key-id key-passphrase count]
   (operation/do-converge-install (cloud-target/provider key-id key-passphrase) (provisioning-spec count))))

(defn server-test
  ([count]
   (operation/do-server-test (cloud-target/provider) (provisioning-spec count)))
  ([key-id key-passphrase count]
   (operation/do-server-test (cloud-target/provider key-id key-passphrase) (provisioning-spec count))))

{'fraction_non_alphanumeric': 0.1288117770767613, 'fraction_numerical': 0.010865755345250614, 'mean_word_length': 4.1929026387625115, 'pattern_counts': {'":': 0, '<': 16, '<?xml version=': 0, '>': 16, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '136476', 'n_tokens_mistral': 2126, 'n_tokens_neox': 2034, 'n_words': 477}