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

Docker dev env #5583

Merged
merged 30 commits into from
Sep 27, 2023
Merged

Docker dev env #5583

merged 30 commits into from
Sep 27, 2023

Conversation

maxgrossman
Copy link
Contributor

  • adds docker-compose.yml and a set of new scripts in the docker and docker/scripts folder that together build a development environment.
  • a Makefile.docker that adds easy aliases to the docker compose commands as well as commands that make sure needed gitignored files/folders are present before docker starts building images/running containers.

One of the requirements we came up with when discussing this was the ability to edit any of the services/core code and recompile it like you can with vagrant.

This can be achieved by updating any one of the HOOT_BUILD_*, found in the hoot.env, to equal 1. Then restart the containers. The core-services-entrypoint.shwill notice this and force recompile/build of the var's corresponding software.

I did not test for the java or node services, though probably should, but I did prove this for core.

After first compiling, I made a small a spelling mistake in the version class. A

After flipping on the core var in hoot.env and restarting the containers, I saw my spelling mistake when running hoot info

If you've already been using vagrant to do your local dev you might need to run make clean or make distclean since files like the Makefile will have hardcoded paths meaningful only to the vm.

@maxgrossman
Copy link
Contributor Author

I will also need to make a commit to the ui repo so that we can set the host names its web server proxy uses to talk to hoot services.

@maxgrossman
Copy link
Contributor Author

curious if vagrant machine used by jenkins has capped resources (same way vagrant vm does for local dev) and if so we can speed up tests by using the containers?

* legacy hoot submodule hoot-ui/ has been removed

* don't need hootenanny-id in core-services container

add parent submodule git volume to frontend to allow npm deps
from github to work

* use node 14 to match core-services, install git for use in npm

* don't need deploy frontend to tomcat

add a make clean target
just deploy exploded webapp, not war file

* use unprotected auth endpoint as health check

* don't need hootenanny-id dir in tomcat

* add clean property, remove UI mention from build services property

* Submodule hoot-ui-2x 9df7cba39..ba88f7ad9:
  > dist/build updates
  > use https to fetch github dependency, refresh lock versions
Copy link
Contributor

@brianhatchl brianhatchl left a comment

Choose a reason for hiding this comment

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

Yeyeye 💪 🕶️

Comment on lines -402 to -410
HOOT_VERSION_FILE: hoot-core/src/main/cpp/hoot/core/info/VersionDefines.h
-include HOOT_VERSION_FILE

hoot-core/src/main/cpp/hoot/core/info/VersionDefines.h:
Copy link
Contributor

Choose a reason for hiding this comment

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

@bmarchant I made this change because we need HOOT_VERSION_GEN to always run. I had whacked a FORCE target that I didn't consider the impact of here cbbaa64 that I think necessitated your change that I'm now fixing with .PHONY.

For some reason the make archive step was failing in some iterations where I tried to restore FORCE and in other iterations it was leading to an infinite loop calling HOOT_VERSION_GEN.

This configuration seems to work in forcing the regeneration of VersionDefines.h on every build without the above defect.

Copy link
Contributor

Choose a reason for hiding this comment

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

Will regenerating VersionDefines.h every time make is run cause a major rebuild? If so, this would slow down compilation during development of Hootenanny outside of docker containers. Maybe somewhere in the docker container the change could be made using sed or something like that.

Copy link
Contributor

@brianhatchl brianhatchl Apr 14, 2023

Choose a reason for hiding this comment

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

I think with the older FORCE target this should have also been the case. But the HOOT_VERSION_GEN script only regenerates VersionDefines.h if the version has actually changed so I think it should be ok. If it has changed that would necessitate a core rebuild of the three cpp classes that include it.

Comment on lines 10 to 26
ARG glpk_version=4.64
ARG liboauthcpp_version=0.1.0
ARG libphonenumber_version=8.12.39
ARG libpostal_version=1.1
ARG node_version=14.16.1
ARG npm_version=6.14.12
ARG v8_version=8.4.371.19
ARG stxxl_version=1.3.1
ARG armadillo_version=10.8.2
ARG gdal_version=3.2.3
ARG geos_version=3.9.3
ARG libgeotiff_version=1.6.0
ARG proj_version=7.2.1
ARG devtoolset_version=8
ARG v8_version=8.4.371.19
ARG stxxl_version=1.3.1
ARG postgresql_version=14
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a way of combining the values found here with the above versions? Also if you notice in that file, Hoot is being built and tested against Postgres 13 not 14. Probably not a big deal but it is already out of sync.

Copy link
Contributor

Choose a reason for hiding this comment

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

💡 good idea
I can look into it

Copy link
Contributor

Choose a reason for hiding this comment

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

* consolidate lib version configs in VagrantProvisionVars.sh for now

* add other ARG values

* move versions to .env template file

* missed adding this template file

* downgrade glpk

* use PG 14

* don't need bash

* these are written in by Makefile.docker

* PG 13 is now working for me
  > update build info
  > Docker updates (#2050)
  > update build info
  > Bump semver from 5.7.1 to 5.7.2 (#2063)
  > Bump word-wrap from 1.2.3 to 1.2.4 (#2064)
  > Treat folders with null parent id as being under root (id=0) (#2065)
  > update build info
  > Add option to clip grail pull data to extent (#2062)
  < replace with hoot2x (reverting lock update)
  < Merge remote-tracking branch 'origin/hoot2x' into docker_updates
  < Merge remote-tracking branch 'origin/hoot2x' into docker_updates
  < dist/build updates
  < use https to fetch github dependency, refresh lock versions
@brianhatchl brianhatchl merged commit 06e30f5 into master Sep 27, 2023
@brianhatchl brianhatchl deleted the docker_dev_env branch September 27, 2023 14:01
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

Successfully merging this pull request may close these issues.

3 participants