Skip to content
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

Lesson 3: directory structure and context unclear #6

Open
pnkfelix opened this issue Jul 15, 2021 · 3 comments
Open

Lesson 3: directory structure and context unclear #6

pnkfelix opened this issue Jul 15, 2021 · 3 comments

Comments

@pnkfelix
Copy link
Contributor

The readme starts by establishing that we should make a subdirectory project01 under ~/environment, and cd into it.

Then we cdk init in there

Then we run cargo new my-example-function, but its not 100% clear what directory we should be in when we run that function: should we be in project01/, or a subdirectory created by cdk init?

Then we are supposed to run cargo +nightly build --release --out-dir=out -Z unstable-options, but that won't work in project01. At the very least, we need to cd into my-example-function

Then immediately after that we edit some python source, and run pip install -r ./requirements.txt. but again, we cannot do that within my-example-function.


I don't mind having to cd all around, and its not unreasonable to expect people to know the context where they need to run each command.

However, what I'm not 100% clear on is where the my-example-function is supposed to be, and without in the absence of a rendering of the expected directory structure and also absence of explicit cd'ing back and forth (which would otherwise give me feedback about the expected structure), I am unsure whether what I am doing is right, and I won't know until I get further down in the steps.

@richardhboyd
Copy link
Owner

This is good feedback, I need to clean this example up to (1) provide more checkpoints what the folder structure looks like at various points and (2) make the desired project structure more clear.

@pnkfelix
Copy link
Contributor Author

Also: There is the text that says "Note that the code parameter is lambda_.Code.from_asset('./my-example-function/out')", but even there, I don't know what directory that python script will run from. The script in question is in project01/project01/project01_stack.py, so that makes me just note yet another place where I am potentially confused about directory context.

@richardhboyd
Copy link
Owner

Also a good point. I should have made clear why we're noting it. I will expand the first part of the readme to explain the context in which the CDK App "synthesizes" to hopefully make why we choose that path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants