rossturk opened a new pull request, #629:
URL: https://github.com/apache/airflow-site/pull/629

   When running `./site.sh build-site` on a new M1-based macOS machine using 
Docker Desktop, I encountered a few problems. The root cause of all of them: 
Docker runs everything inside a `linux/aarch64` container instead of the 
`linux/x86_64` one that you get when you run on an x86 Mac. This manifests in a 
successful `build-image` followed by an unsuccessful `install-node-deps`.
   
   To address these issues I have done the following:
   
   **Remove node-saas**
   The `node-saas` module used by `landing-pages` has been deprecated, and does 
not build on `aarch64`. There is a new module, `saas`, that is a drop-in 
replacement and it does build! This PR swaps out the module.
   
   **Upgrade to Node 16**
   The new `saas` module requires at least Node 12 to run, and we were on 10. I 
decided to upgrade us all the way to 16, which is their LTS. Seemed prudent.
   
   **Build Hugo from source**
   There is no `aarch64` binary for Hugo that I've been able to find. That's a 
huge bummer because it means we have to build one from source if we want it to 
work both inside Docker on newer Macs and *also* inside standard systems and 
CI. Hugo is written in golang, and the version of golang that comes with Debian 
stretch is too old to build the version of Hugo we need. Eep.
   
   This PR introduces an additional stage to the Dockerfile that installs 
`gccgo`, a C-based golang interpreter, and uses it to bootstrap a modern 
version of golang. It then uses _that_ to build Hugo, and copies the binary 
over to the second stage where it can be used in `airflow-site` containers. 
Once the Hugo team starts releasing binaries for this arch, I think we should 
consume them instead.
   
   ---
   
   I've verified that this can be used to successfully build a site on a new M1 
Mac + a traditional x86 Linux server. I plan to come back and finalize this 
draft PR once I've done additional testing to make sure none of this affects 
the site output.
   
   I also plan to do a bit of experimenting with Hugo versions to figure out 
the right one to use. The newest ones do not work, but I am not confident I 
have chosen the most recent (stable) one that does.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to