amundsen icon indicating copy to clipboard operation
amundsen copied to clipboard

document how to build custom frontend without forking

Open jornh opened this issue 4 years ago • 6 comments

Currently burried in a Slack thread

Please hAlp it out from there and into the developers guide/owners manual.

jornh avatar Apr 21 '20 18:04 jornh

thanks @jornh , do you have time to put it in the faq doc?

feng-tao avatar Apr 25 '20 19:04 feng-tao

cc @ttannis @danwom as well

feng-tao avatar Apr 25 '20 19:04 feng-tao

I was looking to play around with this some and hopefully contribute some documentation, but the Slack thread seems to have disappeared in between when I started and now. I did manage to save this part of the discussion, however (sorry, I didn't catch the author of this message):

Yes, that's essentially what we have. The custom build script does the following:

  1. Copy public frontend static files into a temp directory .src-custom
  2. Copy folder containing custom config files into the same temp directory, overwriting any file with the same path/filename
  3. NPM install (or quick install which saves the previous installation)
  4. npm run build (or dev-build)

Then we run the server out of the customized build in .src-custom

https://gist.github.com/danwom/0a735b7137119b974c869a0342986f53

timgilbert avatar May 01 '20 14:05 timgilbert

I was looking to play around with this some and hopefully contribute some documentation, but the Slack thread seems to have disappeared in between when I started and now. I did manage to save this part of the discussion, however (sorry, I didn't catch the author of this message):

Yes, that's essentially what we have. The custom build script does the following:

  1. Copy public frontend static files into a temp directory .src-custom
  2. Copy folder containing custom config files into the same temp directory, overwriting any file with the same path/filename
  3. NPM install (or quick install which saves the previous installation)
  4. npm run build (or dev-build)

Then we run the server out of the customized build in .src-custom https://gist.github.com/danwom/0a735b7137119b974c869a0342986f53

https://amundsenworkspace.slack.com/archives/CGFBVT23V/p1572454944194100

I recently faced this issue as well, and followed the thread where the gist came from, and this worked for me:

Dockerfile.frontend

# Additional steps in node-stage to get custom static conf files
RUN apt-get update && apt-get install -y rsync 
ADD frontend /app/frontend/
WORKDIR /app/frontend/
RUN chmod 755 partnerized-static-build.sh
RUN ./partnerized-static-build.sh
# instead of CMD [ "python3",  "amundsen_application/wsgi.py" ] 
CMD [ "python3",  "frontend/upstream/amundsen_application/wsgi.py" ] 

docker-compose-yml

- STATIC_ROOT=.src-custom/static
command: ["sh", "-c", "cd /app/frontend/upstream && gunicorn -w 2 --bind :5005 amundsen_application.wsgi"]

instazackwu avatar Sep 23 '20 23:09 instazackwu

Would someone like to add this our docs, perhaps an Install custom application section in https://github.com/amundsen-io/amundsenfrontendlibrary/blob/master/docs/installation.md.

ttannis avatar Sep 28 '20 20:09 ttannis

@instazackwu yeah, that will be super useful, would you create a pr about this note? thanks

feng-tao avatar Sep 28 '20 20:09 feng-tao