Heyo , can you please convert this old Acorn cont...
# 🤖|ask-kapa
b
Heyo @microscopic-river-74022 , can you please convert this old Acorn container module to actions? including the task?
Copy code
kind: Module
description: Redis container
type: container
name: redis
image: redis:5-alpine@sha256:1a3c609295332f1ce603948142a132656c92a08149d7096e203058533c415b8c
include: [./modules.garden.yml]
services:
  - name: redis
    ports:
      - name: redis
        containerPort: 6379
    healthCheck:
      command: [redis-cli, ping]
tasks:
  - name: redis-clear
    command: [redis-cli, flushall]
    dependencies: [redis]
m
Please stand by @bright-policeman-43626 as I search the knowledge base. I normally take about 20 seconds or so. :wave:
---------------------- Sure, I can guide you on how to convert your old module configuration to the new actions configuration. However, please note that the conversion process might vary depending on the specific requirements of your project. Here's a general guide on how to convert your module:
Copy code
yaml
kind: Action
name: redis
description: Redis container
steps:
  - name: build
    type: build
    image: redis:5-alpine@sha256:1a3c609295332f1ce603948142a132656c92a08149d7096e203058533c415b8c
    include: [./modules.garden.yml]
  - name: deploy
    type: deploy
    services:
      - name: redis
        ports:
          - name: redis
            containerPort: 6379
        healthCheck:
          command: [redis-cli, ping]
  - name: redis-clear
    type: run
    command: [redis-cli, flushall]
    dependencies: [deploy.redis]
In this new configuration: - The
kind
field is changed from
Module
to
Action
. - The
type
field is removed. - The
build
step is added to build the image. - The
deploy
step is added to deploy the service. - The
run
step is added to run the task. Please note that this is a simplified example and might not cover all the complexities of your project. For a more detailed guide on how to convert modules to actions, you can refer to the Garden documentation (). Also, please be aware that modules are deprecated and will be removed in version
0.14
. It's recommended to use action-based configuration instead (source ()).
Lastly, remember that you can use both module and action configs in the same project, which should make it easier to convert projects piece by piece (source ()). ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
message has been deleted
b
I think you got that wrong @microscopic-river-74022; I was expecting it to look something like this:
Copy code
# Now we have a more explicit Build action
kind: Build
type: container
name: api
description: The backend container for the voting UI

---
# The Deploy action has some top-level settings
kind: Deploy
type: container
name: api
description: The backend deployment for the voting UI
# Uses the container created by the Build action above
build: api
# Dependencies has been moved from the services to here,
# and they can now be much more granular:
# refer to specific Build, Deploy, Run, and Test actions
dependencies: [deploy.redis]

# But most of the previous service can be pasted under spec
spec:
  args: [python, app.py]
  ports:
    - name: http
      protocol: TCP
      containerPort: 80
  healthCheck:
    httpGet:
      path: /api
      port: http
  ingresses:
    - path: /
      hostname: "api.${var.baseHostname}"
      port: http

---
kind: Test
type: container
name: api-unit
build: api
spec:
  args: [echo, ok]

---
kind: Test
type: container
name: api-integ
build: api
dependencies: [deploy.api]
timeout: 200
spec:
  args: [python, /app/test.py]
m
Let me check the knowledge base for you. One moment! :books:
---------------------- I apologize for the confusion earlier. You're correct, the conversion from modules to actions in Garden should look more like your example. Here's how you can convert your Redis container module to actions:
Copy code
yaml
# Build action for Redis
kind: Build
type: container
name: redis
description: Redis container
image: redis:5-alpine@sha256:1a3c609295332f1ce603948142a132656c92a08149d7096e203058533c415b8c
include: [./modules.garden.yml]

---
# Deploy action for Redis
kind: Deploy
type: container
name: redis
description: Redis deployment
build: redis
spec:
  ports:
    - name: redis
      containerPort: 6379
  healthCheck:
    command: [redis-cli, ping]

---
# Run action for Redis clear task
kind: Run
type: container
name: redis-clear
description: Redis clear task
build: redis
dependencies: [deploy.redis]
command: [redis-cli, flushall]
In this new configuration: - Each action (Build, Deploy, Run) is defined separately. - The
kind
field specifies the type of action. - The
type
field specifies the type of module (in this case,
container
). - The
build
field in the Deploy and Run actions refers to the Build action. - The
dependencies
field in the Run action refers to the Deploy action. This configuration provides more granularity and flexibility, which should make it easier to configure complex projects and reduce the number of unnecessary rebuilds (source ()). Remember, modules are deprecated and will be removed in version
0.14
. It's recommended to use action-based configuration instead (source ()). ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
message has been deleted
b
thank you brotha