Skip to content

(R) Change tutorial decorators to new wrappers #601

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions R/inst/tutorials/04-helloaws/helloaws.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

library(metaflow)

# This is the 'start' step. All flows must have a step named
# This is the 'start' step. All flows must have a step named
# 'start' that is the first step in the flow.
start <- function(self){
message("HelloAWS is starting.")
Expand All @@ -13,25 +13,25 @@ start <- function(self){
# A step for metaflow to introduce itself.
hello <- function(self){
self$message <- "We're on the cloud! Metaflow says: Hi!"
print(self$message)
print(self$message)
message("Using metadata provider: ", get_metadata())
}

# This is the 'end' step. All flows must have an 'end' step,
# This is the 'end' step. All flows must have an 'end' step,
# which is the last step in the flow.
end <- function(self){
message("HelloAWS is all done.")
}

metaflow("HelloAWSFlow") %>%
step(step = "start",
r_function = start,
step(step = "start",
r_function = start,
next_step = "hello") %>%
step(step = "hello",
decorator("retry", times=2),
decorator("batch", cpu=2, memory=2048),
r_function = hello,
step(step = "hello",
retry(times=2),
batch(cpu=2, memory=2048),
r_function = hello,
next_step = "end") %>%
step(step = "end",
r_function = end) %>%
step(step = "end",
r_function = end) %>%
run()