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

build: add containerized building #576

Merged
merged 2 commits into from
May 15, 2023
Merged

Conversation

tisonkun
Copy link
Member

@tisonkun tisonkun commented May 15, 2023

This PR fixes apache/pulsar#20272

  • doc
  • doc-required
  • doc-not-needed
  • doc-complete

cc @visortelle @asafm welcome to test in your env:

docker-compose up

... should simply work and you can browse at http://localhost:3000/

tisonkun added 2 commits May 15, 2023 16:45
Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
@tisonkun
Copy link
Member Author

Still, we need .build-versions.json to specify build versions. I'm preparing a patch to use environment variable so that we can easily integrate it in the containerized building process.

@visortelle
Copy link
Member

Confirm, it works.

@visortelle
Copy link
Member

visortelle commented May 15, 2023

Maybe it has sense to implement full build process with Docker?

Let's say, I have such a problem in Python script that runs yarn install:

Screenshot 2023-05-15 at 2 18 56 PM

https://github.com/apache/pulsar-site/actions/runs/4979344185/jobs/8911494860

I'm not sure how I can debug it locally.

The current Docker setup doesn't have any mention of Python, poetry package manager, etc.

@tisonkun
Copy link
Member Author

@visortelle I think of it just now. Let me try it out.

@tisonkun
Copy link
Member Author

@visortelle For the specific issue, maybe try out yarn install to see if any errors?

There are too much legacy scripts logic that need some time to migrate..

@visortelle
Copy link
Member

visortelle commented May 15, 2023

@tisonkun I tried locally. No changes in yarn.lock.
Will set up GitHub Actions for this branch in my fork.

@visortelle
Copy link
Member

visortelle commented May 15, 2023

@tisonkun by the way, I used another command to run child process, and now I at least see the concrete error message cannot find module 'replace-in-files'.

import subprocess

...

def run_command(command):
    process = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
    stdout, stderr = process.communicate()

    if stdout:
        print("STDOUT:")
        print(stdout.decode('utf-8'))
    if stderr:
        print("STDERR:")
        print(stderr.decode('utf-8'))

...

run_command('yarn install')
Screenshot 2023-05-15 at 2 54 10 PM

https://github.com/tealtools/pulsar-site-pip-249/actions/runs/4980539690/jobs/8913580517

Maybe the run command's logging should be also improved.

@tisonkun
Copy link
Member Author

Let's discuss in your fork. It's unrelated to this PR or the upstream code.

Basically, you need to run yarn install before any other command. It looks like your run node scripts/replace.js before yarn install - the script is another tech debt.

@tisonkun
Copy link
Member Author

I'll merge this patch first. Further improvement can be done later. I'll try to directly push some fix on the PIP-249 branch.

@tisonkun tisonkun merged commit 4680b04 into apache:main May 15, 2023
@tisonkun tisonkun deleted the containerized branch May 15, 2023 13:00
@asafm
Copy link
Contributor

asafm commented May 21, 2023

Works great!
Thanks!

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

Successfully merging this pull request may close these issues.

Pulsar site preview should be done in a container
3 participants