easy_ml 0.2.0.pre.rc36 → 0.2.0.pre.rc38

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1a0c29373bfd508492e4fb6867b3636ced97e012d8d87475bc01294eec61c985
4
- data.tar.gz: 1d8686faa419510ea1bb3579ade20edd78f3fde76973acda7187d3548bd2cf4b
3
+ metadata.gz: cc708b35e777f41f67dbf4e769db3c326b01e1e65f29f293c9536d625a60a197
4
+ data.tar.gz: c2ba6d165128c9cbeae2cef19ddc40e823208cc75750aa31d1e167fe8c623cd8
5
5
  SHA512:
6
- metadata.gz: e1b355190a354a16bee776170159a842ffc23b14dddb46dde4656c0921b17fe1a60c124d9b5559f9e890600c8d989711705fe7176df1e0e5bb9103c7bfe26a44
7
- data.tar.gz: 1b9f9d7a76270d8e774efb7afd54b4e50ad79c737eee04a98c7a2651290f58abd73c2f0c2b5c970e64e8cb7de555c005f632182a117173c0d8e67d5b180fa4c4
6
+ metadata.gz: '07835e0557a01b1db47cbbddcd9149813b0cbbd7083eb951613fa31b32234b5c60a348bca5e3a57446ad21fad017882bf9262a4a2f81c4a6962f6bbd1771de0f'
7
+ data.tar.gz: 427e065c5b4e83161c030738aa891ad855c6ca89e8b14d729e6602a0285682ac04712b62e5e226dc521bce05f292f783e0728a9c4a517e3aa8417a632b7b5e65
@@ -4,8 +4,7 @@ export type ColumnType =
4
4
  | "boolean"
5
5
  | "categorical"
6
6
  | "datetime"
7
- | "text"
8
- | "string";
7
+ | "text";
9
8
 
10
9
  export interface Schema {
11
10
  [key: string]: ColumnType;
data/bin/ecs/build ADDED
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env bash
2
+
3
+ echo "Building web image"
4
+ docker compose build web
5
+
6
+ echo "Logging into AWS..."
7
+ aws ecr get-login-password --region AWS_REGION | docker login --username AWS --password-stdin AWS_ACCOUNT.dkr.ecr.AWS_REGION.amazonaws.com
8
+
9
+ echo "Tagging"
10
+ docker tag easy_ml:web easy_ml:worker
11
+ docker tag easy_ml:web easy_ml:zhong
data/bin/ecs/console ADDED
@@ -0,0 +1,5 @@
1
+ #!/bin/bash
2
+
3
+ set -euo pipefail
4
+
5
+ bin/ecs/exec_command.sh "bin/rails console"
data/bin/ecs/deploy ADDED
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env bash
2
+
3
+ bin/ecs/build
4
+
5
+ echo "Logging into AWS..."
6
+ aws ecr get-login-password --region AWS_REGION | docker login --username AWS --password-stdin AWS_ACCOUNT.dkr.ecr.AWS_REGION.amazonaws.com
7
+
8
+ echo "Tagging"
9
+ docker tag easy_ml:web "$AWS_URL":web
10
+ docker tag easy_ml:web "$AWS_URL":worker
11
+ docker tag easy_ml:web "$AWS_URL":zhong
12
+
13
+ echo "Pushing to remote..."
14
+ docker push "$AWS_URL":web
15
+ docker push "$AWS_URL":worker
16
+ docker push "$AWS_URL":zhong
@@ -0,0 +1,62 @@
1
+ #!/usr/bin/env bash
2
+
3
+ CLUSTER_NAME="CLUSTER_NAME"
4
+ SERVICE_NAME="SERVICE_NAME"
5
+ REGION="AWS_REGION"
6
+
7
+ # Validate input
8
+ if [ -z "$1" ]; then
9
+ echo "Usage: $0 <command>"
10
+ echo "Example: $0 /bin/bash"
11
+ exit 1
12
+ fi
13
+
14
+ # Command to run inside the container
15
+ COMMAND="$1"
16
+
17
+ # Step 1: Get the first task ARN
18
+ TASK_ARN=$(aws ecs list-tasks \
19
+ --cluster "$CLUSTER_NAME" \
20
+ --service-name "$SERVICE_NAME" \
21
+ --region "$REGION" \
22
+ --query "taskArns[0]" \
23
+ --output text)
24
+
25
+ if [ "$TASK_ARN" == "None" ]; then
26
+ echo "No running tasks found for service $SERVICE_NAME in cluster $CLUSTER_NAME."
27
+ exit 1
28
+ fi
29
+
30
+ # Step 2: Get container names in the task
31
+ CONTAINER_NAMES=$(aws ecs describe-tasks \
32
+ --cluster "$CLUSTER_NAME" \
33
+ --tasks "$TASK_ARN" \
34
+ --region "$REGION" \
35
+ --query "tasks[0].containers[].name" \
36
+ --output text)
37
+
38
+ # Check if containers exist
39
+ if [ -z "$CONTAINER_NAMES" ]; then
40
+ echo "No containers found in the task $TASK_ARN."
41
+ exit 1
42
+ fi
43
+
44
+ # Step 3: Display container options and prompt user to choose
45
+ echo "Containers available in the task:"
46
+ select CONTAINER_NAME in $CONTAINER_NAMES; do
47
+ if [ -n "$CONTAINER_NAME" ]; then
48
+ echo "You selected container: $CONTAINER_NAME"
49
+ break
50
+ else
51
+ echo "Invalid selection. Please choose a valid container."
52
+ fi
53
+ done
54
+
55
+ # Step 4: Attach to the selected container and run the custom command
56
+ echo "Attaching to container '$CONTAINER_NAME' in task '$TASK_ARN' and running command: $COMMAND..."
57
+ aws ecs execute-command \
58
+ --cluster "$CLUSTER_NAME" \
59
+ --task "$TASK_ARN" \
60
+ --container "$CONTAINER_NAME" \
61
+ --command "$COMMAND" \
62
+ --interactive
data/bin/ecs/ssh ADDED
@@ -0,0 +1,5 @@
1
+ #!/bin/bash
2
+
3
+ set -euo pipefail
4
+
5
+ bin/ecs/exec_command.sh "/bin/bash"
@@ -8,9 +8,10 @@ module EasyML
8
8
  integer: Polars::Int64,
9
9
  boolean: Polars::Boolean,
10
10
  datetime: Polars::Datetime,
11
+ date: Polars::Date,
11
12
  string: Polars::String,
12
13
  text: Polars::String,
13
- categorical: Polars::Categorical
14
+ categorical: Polars::Categorical,
14
15
  }
15
16
  POLARS_MAP = TYPE_MAP.invert.stringify_keys
16
17
  class << self
@@ -37,19 +38,21 @@ module EasyML
37
38
  end
38
39
 
39
40
  type_name = case dtype
40
- when Polars::Float64
41
- :float
42
- when Polars::Int64
43
- :integer
44
- when Polars::Datetime
45
- :datetime
46
- when Polars::Boolean
47
- :boolean
48
- when Polars::Utf8
49
- determine_string_type(series)
50
- else
51
- :categorical
52
- end
41
+ when Polars::Float64
42
+ :float
43
+ when Polars::Int64
44
+ :integer
45
+ when Polars::Datetime
46
+ :datetime
47
+ when Polars::Date
48
+ :date
49
+ when Polars::Boolean
50
+ :boolean
51
+ when Polars::Utf8
52
+ determine_string_type(series)
53
+ else
54
+ :categorical
55
+ end
53
56
 
54
57
  polars_type ? sym_to_polars(type_name) : type_name
55
58
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EasyML
4
- VERSION = "0.2.0-rc36"
4
+ VERSION = "0.2.0-rc38"
5
5
 
6
6
  module Version
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: easy_ml
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0.pre.rc36
4
+ version: 0.2.0.pre.rc38
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brett Shollenberger
@@ -601,6 +601,11 @@ files:
601
601
  - bin/build
602
602
  - bin/build_vite
603
603
  - bin/console
604
+ - bin/ecs/build
605
+ - bin/ecs/console
606
+ - bin/ecs/deploy
607
+ - bin/ecs/exec_command.sh
608
+ - bin/ecs/ssh
604
609
  - bin/rspec
605
610
  - bin/setup
606
611
  - bin/vite