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

Sample App Tutorial Page Compilation #6007

Merged
merged 49 commits into from
Jun 26, 2024
Merged

Conversation

Leo6Leo
Copy link
Member

@Leo6Leo Leo6Leo commented Jun 5, 2024

fixes #5938

Proposed Changes

  • Compile the google doc pages to static web pages with mkdocs

@knative-prow knative-prow bot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jun 5, 2024
@knative-prow knative-prow bot requested review from mmejia02 and ReToCode June 5, 2024 05:58
Copy link

netlify bot commented Jun 5, 2024

Deploy Preview for knative ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 10b0ae6
🔍 Latest deploy log https://app.netlify.com/sites/knative/deploys/66748d7a707cdc0008522b90
😎 Deploy Preview https://deploy-preview-6007--knative.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

docs/bookstore/page-0/page-0-intro.md Outdated Show resolved Hide resolved
docs/bookstore/page-0/page-0-intro.md Outdated Show resolved Hide resolved
docs/bookstore/page-0/page-0-intro.md Outdated Show resolved Hide resolved
docs/bookstore/page-0/page-0-intro.md Outdated Show resolved Hide resolved
docs/bookstore/page-1/pg1-review-svc-1.md Outdated Show resolved Hide resolved
docs/bookstore/page-1/pg1-review-svc-1.md Outdated Show resolved Hide resolved
@pierDipi
Copy link
Member

pierDipi commented Jun 5, 2024

Thanks Leo, this is great!

@aliok
Copy link
Member

aliok commented Jun 5, 2024

I think we should play with the link titles here.

"Bookstore tutorial" and "Quickstart", wdyt?

Screenshot 2024-06-05 at 16 42 51

@Leo6Leo
Copy link
Member Author

Leo6Leo commented Jun 5, 2024

I think we should play with the link titles here.

"Bookstore tutorial" and "Quickstart", wdyt?

Screenshot 2024-06-05 at 16 42 51

I can create a tread and ask how UX WG think, and whether designers have some ideas on it!
The thread for this discussion is here.

@Cali0707
Copy link
Member

Cali0707 commented Jun 5, 2024

@Leo6Leo instead of adding another tab to the top level navigation (which is already too full according to the UX group), can we put the bookstore tutorial under the already existing Tutorial tab? Maybe we can have a start page there that opens to either the quickstart tutorial or the e2e bookstore tutorial?

@Leo6Leo
Copy link
Member Author

Leo6Leo commented Jun 5, 2024

@Leo6Leo instead of adding another tab to the top level navigation (which is already too full according to the UX group), can we put the bookstore tutorial under the already existing Tutorial tab? Maybe we can have a start page there that opens to either the quickstart tutorial or the e2e bookstore tutorial?

Yeah I do agree, the current top level navigation is really packed. And a start page idea sounds good to me! I will reflect the changes in this PR.

@DhairyaMajmudar
Copy link

DhairyaMajmudar commented Jun 5, 2024

How's about adding it in sidebar of getting-started-page ?

And adding a button in home page which can will take users directly to tutorial page, just like it is there in NextJs home page

Header Header
image image

@asr2003
Copy link
Contributor

asr2003 commented Jun 5, 2024

Yes, I agree with @Cali0707. Current nav bar already been tightly packed :) Hopefully we have new design getting it narrow down.
Yes, it's good to have in quick start tutorial that current explore knative button in the home page redirects there

@asr2003
Copy link
Contributor

asr2003 commented Jun 5, 2024

Something from the user perspective, a user(this can be me) can be curious to see what's newly added to the Knative. For an instance, we have introduced this Bookstore tutorial or new releases or new events etc.. It can make a quick access and overview of the what's the latest news of Knative. Can we add any section of What's new? If yes, we can add this beside Needs to Know more, something it seems like we are using more space here :)

cc: @knative/ux-wg-leads

image

@Cali0707
Copy link
Member

Cali0707 commented Jun 5, 2024

Hey @asr2003 that's a neat idea, but I don't think this is the best spot to discuss that. Normally on PRs we just discuss the changes involved in this PR, not ideas for other changes. I would recommend opening an issue in the UX repository or starting a new thread on slack

@asr2003
Copy link
Contributor

asr2003 commented Jun 5, 2024

Just got this idea while exploring this PR, so i have dropped my idea here without further missing any from my mind :)

Okay, we can continue this in our existing thread in ux channel

Leo6Leo and others added 2 commits June 5, 2024 14:41
Co-authored-by: Pierangelo Di Pilato <pierangelodipilato@gmail.com>
@knative-prow knative-prow bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jun 5, 2024
Leo6Leo and others added 2 commits June 20, 2024 16:02
Co-authored-by: Christoph Stäbler <cstabler@redhat.com>
Co-authored-by: Pierangelo Di Pilato <pierangelodipilato@gmail.com>
@pierDipi
Copy link
Member

@matzew is this PR something you can take a look at?


![Image](images/image13.png)

Please follow the instructions [here](https://knative.dev/docs/install/){:target="_blank"} to spin up your cluster with Knative installed!
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we mention we do recommend kn quickstart ?


**Create a SinkBinding:**

- 1: Create a new YAML file named `300-sinkbinding.yaml` in the `node-server/config` folder and add the following content:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please use the full path (node-server/config/300-sinkbinding.yaml), yes that is repaetive but much nice for copy paste.


**Create an Event Display Service:**

- 1: Create a new YAML file named `100-event-display.yaml` in the `node-server/config` folder and add the following content:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same. not copy-pasta friendly :-)

In this case, we are creating a Python function, so the command will be:

```
func create -l python sentiment-analysis-app
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At some ppint we need to update this.

We are currently rewriting the py middleware, and will likely create also a few new templates.
But that is second half of 2024 - hopefully /cc @lkingland

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Issue created to keep track this. #6044


In order to properly use the `textblob` library, you need to download the corpora, which is a large collection of text data that is used to train the sentiment analysis model. You can do this by creating a new file called `setup.py`, Knative Function will ensure that the `setup.py` file is executed after the dependencies have been installed.

The `setup.py` file should contain the following code for your bookstore:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure this is all really needed.

I think the tutorial is already complex, as it covers a lot of things.

For folks have no idea on python, I guess they are all lost .

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In order to use textblob library, we have to download their corpora file before hand. Unless there are any other methods we can do that, I think the setup.py part tutorial is necessary, and this approach is not documented anywhere in Knative's website. WDYT? @matzew

After you have finished the code, you can deploy the function to the cluster using the following command:

```bash
func deploy -b=s2i -v
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

➜ sentiment-analysis-app git:(10b0ae6) ✗ func deploy
function up-to-date. Force rebuild with --build
Pushing function image to the registry "index.docker.io" using the "matzew" user credentials
⬆️ Deploying function to the cluster
^C
Service output:
Traceback (most recent call last):
File "/layers/paketo-buildpacks_cpython/cpython/lib/python3.10/runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/layers/paketo-buildpacks_cpython/cpython/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/layers/paketo-buildpacks_pip-install/packages/lib/python3.10/site-packages/parliament/main.py", line 29, in
main()
File "/layers/paketo-buildpacks_pip-install/packages/lib/python3.10/site-packages/parliament/main.py", line 20, in main
app = server.create(server.load(sys.argv[1]))
File "/layers/paketo-buildpacks_pip-install/packages/lib/python3.10/site-packages/parliament/server.py", line 16, in load
import func
File "/workspace/func.py", line 4, in
from textblob import TextBlob
File "/layers/paketo-buildpacks_pip-install/packages/lib/python3.10/site-packages/textblob/init.py", line 1, in
from .blob import Blobber, Sentence, TextBlob, Word, WordList
File "/layers/paketo-buildpacks_pip-install/packages/lib/python3.10/site-packages/textblob/blob.py", line 26, in
import nltk
File "/layers/paketo-buildpacks_pip-install/packages/lib/python3.10/site-packages/nltk/init.py", line 153, in
from nltk.translate import *
File "/layers/paketo-buildpacks_pip-install/packages/lib/python3.10/site-packages/nltk/translate/init.py", line 24, in
from nltk.translate.meteor_score import meteor_score as meteor
File "/layers/paketo-buildpacks_pip-install/packages/lib/python3.10/site-packages/nltk/translate/meteor_score.py", line 13, in
from nltk.corpus import WordNetCorpusReader, wordnet
File "/layers/paketo-buildpacks_pip-install/packages/lib/python3.10/site-packages/nltk/corpus/init.py", line 64, in
from nltk.corpus.reader import *
File "/layers/paketo-buildpacks_pip-install/packages/lib/python3.10/site-packages/nltk/corpus/reader/init.py", line 106, in
from nltk.corpus.reader.panlex_lite import *
File "/layers/paketo-buildpacks_pip-install/packages/lib/python3.10/site-packages/nltk/corpus/reader/panlex_lite.py", line 15, in
import sqlite3
File "/layers/paketo-buildpacks_cpython/cpython/lib/python3.10/sqlite3/init.py", line 57, in
from sqlite3.dbapi2 import *
File "/layers/paketo-buildpacks_cpython/cpython/lib/python3.10/sqlite3/dbapi2.py", line 27, in
from _sqlite3 import *
ImportError: libsqlite3.so.0: cannot open shared object file: No such file or directory
Traceback (most recent call last):
File "/layers/paketo-buildpacks_cpython/cpython/lib/python3.10/runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/layers/paketo-buildpacks_cpython/cpython/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/layers/paketo-buildpacks_pip-install/packages/lib/python3.10/site-packages/parliament/main.py", line 29, in
main()
File "/layers/paketo-buildpacks_pip-install/packages/lib/python3.10/site-packages/parliament/main.py", line 20, in main
app = server.create(server.load(sys.argv[1]))
File "/layers/paketo-buildpacks_pip-install/packages/lib/python3.10/site-packages/parliament/server.py", line 16, in load
import func
File "/workspace/func.py", line 4, in
from textblob import TextBlob
File "/layers/paketo-buildpacks_pip-install/packages/lib/python3.10/site-packages/textblob/init.py", line 1, in
from .blob import Blobber, Sentence, TextBlob, Word, WordList
File "/layers/paketo-buildpacks_pip-install/packages/lib/python3.10/site-packages/textblob/blob.py", line 26, in
import nltk
File "/layers/paketo-buildpacks_pip-install/packages/lib/python3.10/site-packages/nltk/init.py", line 153, in
from nltk.translate import *
File "/layers/paketo-buildpacks_pip-install/packages/lib/python3.10/site-packages/nltk/translate/init.py", line 24, in
from nltk.translate.meteor_score import meteor_score as meteor
File "/layers/paketo-buildpacks_pip-install/packages/lib/python3.10/site-packages/nltk/translate/meteor_score.py", line 13, in
from nltk.corpus import WordNetCorpusReader, wordnet
File "/layers/paketo-buildpacks_pip-install/packages/lib/python3.10/site-packages/nltk/corpus/init.py", line 64, in
from nltk.corpus.reader import *
File "/layers/paketo-buildpacks_pip-install/packages/lib/python3.10/site-packages/nltk/corpus/reader/init.py", line 106, in
from nltk.corpus.reader.panlex_lite import *
File "/layers/paketo-buildpacks_pip-install/packages/lib/python3.10/site-packages/nltk/corpus/reader/panlex_lite.py", line 15, in
import sqlite3
File "/layers/paketo-buildpacks_cpython/cpython/lib/python3.10/sqlite3/init.py", line 57, in
from sqlite3.dbapi2 import *
File "/layers/paketo-buildpacks_cpython/cpython/lib/python3.10/sqlite3/dbapi2.py", line 27, in
from _sqlite3 import *
ImportError: libsqlite3.so.0: cannot open shared object file: No such file or directory
Traceback (most recent call last):
File "/layers/paketo-buildpacks_cpython/cpython/lib/python3.10/runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/layers/paketo-buildpacks_cpython/cpython/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/layers/paketo-buildpacks_pip-install/packages/lib/python3.10/site-packages/parliament/main.py", line 29, in
main()
File "/layers/paketo-buildpacks_pip-install/packages/lib/python3.10/site-packages/parliament/main.py", line 20, in main
app = server.create(server.load(sys.argv[1]))
File "/layers/paketo-buildpacks_pip-install/packages/lib/python3.10/site-packages/parliament/server.py", line 16, in load
import func
File "/workspace/func.py", line 4, in
from textblob import TextBlob
File "/layers/paketo-buildpacks_pip-install/packages/lib/python3.10/site-packages/textblob/init.py", line 1, in
from .blob import Blobber, Sentence, TextBlob, Word, WordList
File "/layers/paketo-buildpacks_pip-install/packages/lib/python3.10/site-packages/textblob/blob.py", line 26, in
import nltk
File "/layers/paketo-buildpacks_pip-install/packages/lib/python3.10/site-packages/nltk/init.py", line 153, in
from nltk.translate import *
File "/layers/paketo-buildpacks_pip-install/packages/lib/python3.10/site-packages/nltk/translate/init.py", line 24, in
from nltk.translate.meteor_score import meteor_score as meteor
File "/layers/paketo-buildpacks_pip-install/packages/lib/python3.10/site-packages/nltk/translate/meteor_score.py", line 13, in
from nltk.corpus import WordNetCorpusReader, wordnet
File "/layers/paketo-buildpacks_pip-install/packages/lib/python3.10/site-packages/nltk/corpus/init.py", line 64, in
from nltk.corpus.reader import *
File "/layers/paketo-buildpacks_pip-install/packages/lib/python3.10/site-packages/nltk/corpus/reader/init.py", line 106, in
from nltk.corpus.reader.panlex_lite import *
File "/layers/paketo-buildpacks_pip-install/packages/lib/python3.10/site-packages/nltk/corpus/reader/panlex_lite.py", line 15, in
import sqlite3
File "/layers/paketo-buildpacks_cpython/cpython/lib/python3.10/sqlite3/init.py", line 57, in
from sqlite3.dbapi2 import *
File "/layers/paketo-buildpacks_cpython/cpython/lib/python3.10/sqlite3/dbapi2.py", line 27, in
from _sqlite3 import *
ImportError: libsqlite3.so.0: cannot open shared object file: No such file or directory
Traceback (most recent call last):
File "/layers/paketo-buildpacks_cpython/cpython/lib/python3.10/runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/layers/paketo-buildpacks_cpython/cpython/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/layers/paketo-buildpacks_pip-install/packages/lib/python3.10/site-packages/parliament/main.py", line 29, in
main()
File "/layers/paketo-buildpacks_pip-install/packages/lib/python3.10/site-packages/parliament/main.py", line 20, in main
app = server.create(server.load(sys.argv[1]))
File "/layers/paketo-buildpacks_pip-install/packages/lib/python3.10/site-packages/parliament/server.py", line 16, in load
import func
File "/workspace/func.py", line 4, in
from textblob import TextBlob
File "/layers/paketo-buildpacks_pip-install/packages/lib/python3.10/site-packages/textblob/init.py", line 1, in
from .blob import Blobber, Sentence, TextBlob, Word, WordList
File "/layers/paketo-buildpacks_pip-install/packages/lib/python3.10/site-packages/textblob/blob.py", line 26, in
import nltk
File "/layers/paketo-buildpacks_pip-install/packages/lib/python3.10/site-packages/nltk/init.py", line 153, in
from nltk.translate import *
File "/layers/paketo-buildpacks_pip-install/packages/lib/python3.10/site-packages/nltk/translate/init.py", line 24, in
from nltk.translate.meteor_score import meteor_score as meteor
File "/layers/paketo-buildpacks_pip-install/packages/lib/python3.10/site-packages/nltk/translate/meteor_score.py", line 13, in
from nltk.corpus import WordNetCorpusReader, wordnet
File "/layers/paketo-buildpacks_pip-install/packages/lib/python3.10/site-packages/nltk/corpus/init.py", line 64, in
from nltk.corpus.reader import *
File "/layers/paketo-buildpacks_pip-install/packages/lib/python3.10/site-packages/nltk/corpus/reader/init.py", line 106, in
from nltk.corpus.reader.panlex_lite import *
File "/layers/paketo-buildpacks_pip-install/packages/lib/python3.10/site-packages/nltk/corpus/reader/panlex_lite.py", line 15, in
import sqlite3
File "/layers/paketo-buildpacks_cpython/cpython/lib/python3.10/sqlite3/init.py", line 57, in
from sqlite3.dbapi2 import *
File "/layers/paketo-buildpacks_cpython/cpython/lib/python3.10/sqlite3/dbapi2.py", line 27, in
from _sqlite3 import *
ImportError: libsqlite3.so.0: cannot open shared object file: No such file or directory
Traceback (most recent call last):
File "/layers/paketo-buildpacks_cpython/cpython/lib/python3.10/runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/layers/paketo-buildpacks_cpython/cpython/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/layers/paketo-buildpacks_pip-install/packages/lib/python3.10/site-packages/parliament/main.py", line 29, in
main()
File "/layers/paketo-buildpacks_pip-install/packages/lib/python3.10/site-packages/parliament/main.py", line 20, in main
app = server.create(server.load(sys.argv[1]))
File "/layers/paketo-buildpacks_pip-install/packages/lib/python3.10/site-packages/parliament/server.py", line 16, in load
import func
File "/workspace/func.py", line 4, in
from textblob import TextBlob
File "/layers/paketo-buildpacks_pip-install/packages/lib/python3.10/site-packages/textblob/init.py", line 1, in
from .blob import Blobber, Sentence, TextBlob, Word, WordList
File "/layers/paketo-buildpacks_pip-install/packages/lib/python3.10/site-packages/textblob/blob.py", line 26, in
import nltk
File "/layers/paketo-buildpacks_pip-install/packages/lib/python3.10/site-packages/nltk/init.py", line 153, in
from nltk.translate import *
File "/layers/paketo-buildpacks_pip-install/packages/lib/python3.10/site-packages/nltk/translate/init.py", line 24, in
from nltk.translate.meteor_score import meteor_score as meteor
File "/layers/paketo-buildpacks_pip-install/packages/lib/python3.10/site-packages/nltk/translate/meteor_score.py", line 13, in
from nltk.corpus import WordNetCorpusReader, wordnet
File "/layers/paketo-buildpacks_pip-install/packages/lib/python3.10/site-packages/nltk/corpus/init.py", line 64, in
from nltk.corpus.reader import *
File "/layers/paketo-buildpacks_pip-install/packages/lib/python3.10/site-packages/nltk/corpus/reader/init.py", line 106, in
from nltk.corpus.reader.panlex_lite import *
File "/layers/paketo-buildpacks_pip-install/packages/lib/python3.10/site-packages/nltk/corpus/reader/panlex_lite.py", line 15, in
import sqlite3
File "/layers/paketo-buildpacks_cpython/cpython/lib/python3.10/sqlite3/init.py", line 57, in
from sqlite3.dbapi2 import *
File "/layers/paketo-buildpacks_cpython/cpython/lib/python3.10/sqlite3/dbapi2.py", line 27, in
from _sqlite3 import *
ImportError: libsqlite3.so.0: cannot open shared object file: No such file or directory
Traceback (most recent call last):
File "/layers/paketo-buildpacks_cpython/cpython/lib/python3.10/runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/layers/paketo-buildpacks_cpython/cpython/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/layers/paketo-buildpacks_pip-install/packages/lib/python3.10/site-packages/parliament/main.py", line 29, in
main()
File "/layers/paketo-buildpacks_pip-install/packages/lib/python3.10/site-packages/parliament/main.py", line 20, in main
app = server.create(server.load(sys.argv[1]))
File "/layers/paketo-buildpacks_pip-install/packages/lib/python3.10/site-packages/parliament/server.py", line 16, in load
import func
File "/workspace/func.py", line 4, in
from textblob import TextBlob
File "/layers/paketo-buildpacks_pip-install/packages/lib/python3.10/site-packages/textblob/init.py", line 1, in
from .blob import Blobber, Sentence, TextBlob, Word, WordList
File "/layers/paketo-buildpacks_pip-install/packages/lib/python3.10/site-packages/textblob/blob.py", line 26, in
import nltk
File "/layers/paketo-buildpacks_pip-install/packages/lib/python3.10/site-packages/nltk/init.py", line 153, in
from nltk.translate import *
File "/layers/paketo-buildpacks_pip-install/packages/lib/python3.10/site-packages/nltk/translate/init.py", line 24, in
from nltk.translate.meteor_score import meteor_score as meteor
File "/layers/paketo-buildpacks_pip-install/packages/lib/python3.10/site-packages/nltk/translate/meteor_score.py", line 13, in
from nltk.corpus import WordNetCorpusReader, wordnet
File "/layers/paketo-buildpacks_pip-install/packages/lib/python3.10/site-packages/nltk/corpus/init.py", line 64, in
from nltk.corpus.reader import *
File "/layers/paketo-buildpacks_pip-install/packages/lib/python3.10/site-packages/nltk/corpus/reader/init.py", line 106, in
from nltk.corpus.reader.panlex_lite import *
File "/layers/paketo-buildpacks_pip-install/packages/lib/python3.10/site-packages/nltk/corpus/reader/panlex_lite.py", line 15, in
import sqlite3
File "/layers/paketo-buildpacks_cpython/cpython/lib/python3.10/sqlite3/init.py", line 57, in
from sqlite3.dbapi2 import *
File "/layers/paketo-buildpacks_cpython/cpython/lib/python3.10/sqlite3/dbapi2.py", line 27, in
from _sqlite3 import *
ImportError: libsqlite3.so.0: cannot open shared object file: No such file or directory
Traceback (most recent call last):
File "/layers/paketo-buildpacks_cpython/cpython/lib/python3.10/runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/layers/paketo-buildpacks_cpython/cpython/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/layers/paketo-buildpacks_pip-install/packages/lib/python3.10/site-packages/parliament/main.py", line 29, in
main()
File "/layers/paketo-buildpacks_pip-install/packages/lib/python3.10/site-packages/parliament/main.py", line 20, in main
app = server.create(server.load(sys.argv[1]))
File "/layers/paketo-buildpacks_pip-install/packages/lib/python3.10/site-packages/parliament/server.py", line 16, in load
import func
File "/workspace/func.py", line 4, in
from textblob import TextBlob
File "/layers/paketo-buildpacks_pip-install/packages/lib/python3.10/site-packages/textblob/init.py", line 1, in
from .blob import Blobber, Sentence, TextBlob, Word, WordList
File "/layers/paketo-buildpacks_pip-install/packages/lib/python3.10/site-packages/textblob/blob.py", line 26, in
import nltk
File "/layers/paketo-buildpacks_pip-install/packages/lib/python3.10/site-packages/nltk/init.py", line 153, in
from nltk.translate import *
File "/layers/paketo-buildpacks_pip-install/packages/lib/python3.10/site-packages/nltk/translate/init.py", line 24, in
from nltk.translate.meteor_score import meteor_score as meteor
File "/layers/paketo-buildpacks_pip-install/packages/lib/python3.10/site-packages/nltk/translate/meteor_score.py", line 13, in
from nltk.corpus import WordNetCorpusReader, wordnet
File "/layers/paketo-buildpacks_pip-install/packages/lib/python3.10/site-packages/nltk/corpus/init.py", line 64, in
from nltk.corpus.reader import *
File "/layers/paketo-buildpacks_pip-install/packages/lib/python3.10/site-packages/nltk/corpus/reader/init.py", line 106, in
from nltk.corpus.reader.panlex_lite import *
File "/layers/paketo-buildpacks_pip-install/packages/lib/python3.10/site-packages/nltk/corpus/reader/panlex_lite.py", line 15, in
import sqlite3
File "/layers/paketo-buildpacks_cpython/cpython/lib/python3.10/sqlite3/init.py", line 57, in
from sqlite3.dbapi2 import *
File "/layers/paketo-buildpacks_cpython/cpython/lib/python3.10/sqlite3/dbapi2.py", line 27, in
from _sqlite3 import *
ImportError: libsqlite3.so.0: cannot open shared object file: No such file or directory

deploy error: knative deployer failed to wait for the Knative Service to become ready: context canceled
Error: knative deployer failed to wait for the Knative Service to become ready: context canceled

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please say that s2i is required and the default pack does NOT work


The `setup.py` file should contain the following code for your bookstore:

???+ abstract "_sentiment-analysis-app/setup.py_"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just include? no other steps like referencing?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No! Just Include the setup.py file, then all good!


---

### **Step 1: Create a Knative Function template**
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I miss instructions here to copy paste the commands for that "create"


## **Implementation**

### **Step 0: Learn Sequence**
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice to use the sequence for this. Is a good fit here!

Spot on!

In this section, we will just be simply running a PostgreSQL service. We have all config files ready. Simply run the following command to apply all yamls at once.

```sh
kubectl apply -f db-service
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess I'd list each file, and have one / two sentences on what that is .

This DB is option, but just applying a bag of yaml is not always helpful :-)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm on the opposite opinion as it's not the point of the tutorial to explain how to deploy a database on Kubernetes

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't explain it in here, but we have the detailed explanation in the db-service README.md


![image2](images/image2.png)

???+ bug "Troubleshoot"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move this box up - I was stuck here too, and afterwards read the hint :-)

job.batch/postgresql-job created
```

Wait a moment until all the pods become available and the database migration job is completed. If you see some job pods are failing and **having errors, don't worry**, please wait until at least one job becomes "**Completed**".
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd highlight this a bit

@matzew
Copy link
Member

matzew commented Jun 25, 2024

A nice, and lengthly tutorial

This is something that we could use for like 3 hiur workshops at conferences.

Very nice !

@matzew
Copy link
Member

matzew commented Jun 25, 2024

LGTM

I am not sure if some of @pierDipi's comments need to be addressed as well - mine are cosmetics, and I added hints what I found sub-optimal, feel free to polish this in a different PR

@pierDipi
Copy link
Member

/lgtm
/approve

@knative-prow knative-prow bot added the lgtm Indicates that a PR is ready to be merged. label Jun 26, 2024
Copy link

knative-prow bot commented Jun 26, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Leo6Leo, pierDipi

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@matzew
Copy link
Member

matzew commented Jun 26, 2024

/unhold

@knative-prow knative-prow bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 26, 2024
@knative-prow knative-prow bot merged commit 54207be into knative:main Jun 26, 2024
19 checks passed
@matzew
Copy link
Member

matzew commented Jun 26, 2024

/cherry-pick release-1.14

@knative-prow-robot
Copy link
Contributor

@matzew: #6007 failed to apply on top of branch "release-1.14":

Applying: feat: add the first three pages of the sample app tutorial
Applying: Apply suggestions from code review
Applying: fix: fix the review comments in pg0 and pg1
Applying: feat: add blog post 2
Applying: feat: adding the images for page 2
Applying: add: add more pages
Applying: add: adding the rest of the pages
Applying: add: modify the nav
Applying: add: finishing polishing
Applying: fix: update the iframe embedded video link
Applying: fix: fix the video embedding dimension and the access
Applying: fix: link minor error fix
Applying: fix: hide the setup script section
Applying: Apply suggestions from code review
Applying: Update docs/bookstore/page-0/page-0-intro.md
Applying: Update docs/bookstore/page-0.5/pg0.5-env-setup.md
Applying: fix: fix christoph's comment
Applying: fix: Remove all the extra new lines
Applying: fix: update kubernetes to Kubernetes
Applying: Apply suggestions from code review
Applying: fix: fix the wrong indentation in the yaml files
.git/rebase-apply/patch:107: trailing whitespace.
    
.git/rebase-apply/patch:139: trailing whitespace.
    ```yaml 
.git/rebase-apply/patch:183: trailing whitespace.
      badwordfilter: 
.git/rebase-apply/patch:205: trailing whitespace.
    ```yaml 
.git/rebase-apply/patch:279: trailing whitespace.
    ```yaml 
warning: 5 lines add whitespace errors.
Using index info to reconstruct a base tree...
A	code-samples/eventing/bookstore-sample-app/solution/node-server/config/100-event-display.yaml
A	code-samples/eventing/bookstore-sample-app/start/slack-sink/application.properties
Falling back to patching base and 3-way merge...
CONFLICT (modify/delete): code-samples/eventing/bookstore-sample-app/start/slack-sink/application.properties deleted in HEAD and modified in fix: fix the wrong indentation in the yaml files. Version fix: fix the wrong indentation in the yaml files of code-samples/eventing/bookstore-sample-app/start/slack-sink/application.properties left in tree.
CONFLICT (modify/delete): code-samples/eventing/bookstore-sample-app/solution/node-server/config/100-event-display.yaml deleted in HEAD and modified in fix: fix the wrong indentation in the yaml files. Version fix: fix the wrong indentation in the yaml files of code-samples/eventing/bookstore-sample-app/solution/node-server/config/100-event-display.yaml left in tree.
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0021 fix: fix the wrong indentation in the yaml files
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherry-pick release-1.14

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@matzew
Copy link
Member

matzew commented Jun 26, 2024

ok, than not :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sample App: Documentation Cleanup
10 participants