These are chat archives for reactioncommerce/reaction

26th
Oct 2018
Nathan
@kwnath
Oct 26 2018 09:29
Tried finding a guide but wasn't able to find one that explained what is needed etc. Trying to install all necessary containers for kubernetes
Any help is sappreciated!
zzh1234567
@zzh1234567
Oct 26 2018 13:39
@stunjiturner no classic UI....
Hairy Chris
@hairychris
Oct 26 2018 14:51
@kwnath here is a docker-compose I knocked up for myself to use, it shouldnt be much work to convert it to kubernetes
# This is a demo docker-compose file.
# Usage: docker-compose -f docker-compose.yml up [-d]

version: '3.4'

services:
  hydra-migrate:
    image: $HYDRA_IMAGE
    command: migrate sql -e
    depends_on:
      - postgres
    networks:
      postgresnet:
    env_file:
      - "./hydra.env"
#   environment:
#      - LOG_LEVEL=debug
    restart: on-failure

  hydra:
    image: $HYDRA_IMAGE
    command: serve all --dangerous-force-http
    depends_on:
      - hydra-migrate
      - postgres
    networks:
      auth:
      reverseproxy1:
      postgresnet:
      monitoring:
    labels:
      - "traefik.frontend.rule=Host:auth.${TRAEFIK_HOST}"
      - "traefik.frontend.entryPoints=http,https"
      - "traefik.frontend.headers.SSLRedirect=true"
      - "traefik.docker.network=noonchi_reverseproxy1"
      - "traefik.port=4444"
      - "traefik.enable=true"
    # ports:
      # # Public port
      # - "4444:4444"
      # # Admin port
      # - "127.0.0.1:4445:4445"
      # # Port for hydra token user
      # - "127.0.0.1:5555:5555"
    env_file:
      - "./hydra.env"
    environment:
#     - LOG_LEVEL=debug
#     - OAUTH2_SHARE_ERROR_DEBUG=1
      - OIDC_SUBJECT_TYPES_SUPPORTED=public,pairwise
#     - OAUTH2_ACCESS_TOKEN_STRATEGY=jwt
      - DISABLE_TELEMETRY=1
    restart: unless-stopped

  postgres:
    image: postgres:10.3
    env_file:
      ./postgres.env
    networks:
      postgresnet:
    # ports:
    #   # DO NOT EXPOSE PORTS UNLESS YOU KNOW WHAT YOU ARE DOING
    #   - 127.0.0.1:5432
    volumes:
      - postgres-data:/var/lib/postgresql/data
    restart: unless-stopped

  reaction:
    image: reactioncommerce/reaction:release-2.0.0-rc.6
    depends_on:
      - mongo
    env_file:
      - "./reaction.env"
    environment:
      # MONGO_OPLOG_URL: "mongodb://mongo:27017/local"
      HYDRA_ADMIN_URL: "https://hydra:4445"
      HYDRA_OAUTH2_INTROSPECT_URL: "https://hydra:4445/oauth2/introspect"
    networks:
      api:
      auth:
      mongonet:
      reverseproxy2:
    labels:
      - "traefik.frontend.rule=Host:${TRAEFIK_HOST}"
      - "traefik.frontend.entryPoints=http,https"
      - "traefik.frontend.headers.SSLRedirect=true"
      - "traefik.docker.network=noonchi_reverseproxy2"
      - "traefik.port=3000"
      - "traefik.enable=true"
    restart: unless-stopped
    # ports:
    #   - "3000:3000"

  mongo:
    image: mongo:4.1
    command: mongod --storageEngine=wiredTiger
    networks:
      mongonet:
    # ports:
    #   # DO NOT EXPOSE PORTS UNLESS YOU KNOW WHAT YOU ARE DOING
    #   - "127.0.0.1:27017:27017"
    volumes:
      - mongo-db:/data/db
    restart: unless-stopped

  traefik:
    image: traefik:alpine
    restart: unless-stopped
    command: --web --metrics.prometheus \
              --acme.storage=/etc/traefik/acme.json --logLevel=info \
              ${TRAEFIK_ENTRYPOINT_HTTP} ${TRAEFIK_ENTRYPOINT_HTTPS}\
              --defaultentrypoints=${TRAEFIK_DEFAULT_ENTRYPOINTS} \
              --acme=${ACME_ENABLE} --acme.entrypoint=https --acme.httpchallenge --acme.httpchallenge.entrypoint=http \
              --acme.domains="${ACME_DOMAINS}" --acme.email="${ACME_EMAIL}" \
              --docker --docker.domain="${DOCKER_DOMAIN}" --docker.endpoint="unix:///var/run/docker.sock" \
              --docker.watch=true --docker.exposedbydefault="false"
    container_name: traefik
    networks:
      - reverseproxy1
      - reverseproxy2
      - monitoring
    ports:
      - "80:80"
      - "443:443"
      - "127.0.0.1:8080:8080"
    volumes:
      - traefik-data:/etc/traefik/
      - /var/run/docker.sock:/var/run/docker.sock

  prometheus:
    image: quay.io/prometheus/prometheus:latest
    volumes:
      - /root/prometheus:/etc/prometheus/
      - prometheus-data:/prometheus
    command:
      - '--config.file=/etc/prometheus/prometheus.yml'
      - '--storage.tsdb.path=/prometheus'
      - '--web.console.libraries=/usr/share/prometheus/console_libraries'
      - '--web.console.templates=/usr/share/prometheus/consoles'
    networks:
      - monitoring
    ports:
      - "127.0.0.1:9090:9090"
    restart: unless-stopped

  prometheus-node-exporter:
    image: prom/node-exporter
    volumes:
      - /proc:/host/proc:ro
      - /sys:/host/sys:ro
      - /:/rootfs:ro
    command: 
      - '--path.procfs=/host/proc' 
      - '--path.sysfs=/host/sys'
      - --collector.filesystem.ignored-mount-points
      - "^/(sys|proc|dev|host|etc|rootfs/var/lib/docker/containers|rootfs/var/lib/docker/overlay2|rootfs/run/docker/netns|rootfs/var/lib/docker/aufs)($$|/)"
    # ports:
    #   - "127.0.0.1:9100:9100"
    networks:
      - monitoring
    restart: unless-stopped

networks:
  api:
  auth:
  mongonet:
  postgresnet:
  reverseproxy1:
  reverseproxy2:
  monitoring:

volumes:
  mongo-db:
  postgres-data:
  traefik-data:
  prometheus-config:
  prometheus-data:
there are a few issues with it
and you will need to populate the relevant env_files
I think ive somehow used a release branch for RC6 so check that
but yeah its a start at least
Nathan
@kwnath
Oct 26 2018 15:28
Thanks @hairychris will look into this!
Hairy Chris
@hairychris
Oct 26 2018 15:38
no worries hit me up if you get stuck
took me a while to figure it out, no point duplicating effort
if you see any mistakes would you kindly feed them back so I can fix my deployment too
S Tunji Turner
@stunjiturner
Oct 26 2018 15:59
@hairychris can you make a gist
Yashaswi Maharshi
@mahayash
Oct 26 2018 16:11
@stunjiturner I have read on quora and done random search on google
Hairy Chris
@hairychris
Oct 26 2018 17:36
@stunjiturner I will once it's a bit more together but I don't want to encourage people to use it without looking yet

@jdaddy73 after reading the blog post, the business case my company is more muddled than ever, no marketplace implementation in 2.0?? No bug fixes for issues in the old architecture. No heroku? No new deployment docs?

I think this is a very important point, so say you have a live production install of marketplace today. You'd stay on version 1 until security releases end next July, ignore any bugs with the current implementation and hope that marketplace 2.0 is done by then.

is there any way to crowd fund this?
I'd happily put in and im sure others would
could that accelerate the roadmap at all?
William Moss
@willmoss1000
Oct 26 2018 18:54
@hairychris yes, marketplace was the key reason for me to use reaction
Hairy Chris
@hairychris
Oct 26 2018 18:56
indeed, great work on hop.exchange btw, are things going well?
William Moss
@willmoss1000
Oct 26 2018 18:57
@hairychris yes great thanks. Just a little concerned about 2.0
Hairy Chris
@hairychris
Oct 26 2018 18:57
yeah, you seem to be relatively ok until July next year
but its a shame not to be able to take advantage of the performance fixes and graphql frontend
and even stopping community pull requests seems quite drastic, surely if the community wants to support the older version they should be allowed to
William Moss
@willmoss1000
Oct 26 2018 18:59
Yep, definitely the right direction though to constrain what they're trying to achieve, and build a great quality product. Fingers crossed It'll be OK until then, and the transition to 2.0 won't be too scary!
Hairy Chris
@hairychris
Oct 26 2018 19:02
yup agreed, fingers crossed, once more info is known we can come up with a path forward
William Moss
@willmoss1000
Oct 26 2018 19:03
So - for some reason the carts have not been getting removed by cartCleanupJob. In order to test I've set the frequency way higher and I'm seeing Exception in setTimeout callback: TypeError: moment is not a function at JobQueue.Jobs.processJobs [as worker] (imports/plugins/included/jobcontrol/server/jobs/cart.js:74:25)
sorry for the tangent!
William Moss
@willmoss1000
Oct 26 2018 19:53

Really not making a lot of sense to me. It starts out

carts.forEach((cart) => {
        const account = Accounts.findOne({ _id: cart.accountId });
        const removeCart = Cart.remove({ accountId: account._id });

However, some carts won't have an accountId - surely this can't be right?

Hairy Chris
@hairychris
Oct 26 2018 20:13
why wouldn't a cart have an accountId?
surely it would be set to a guest accountId or a registered user accountId
pretty sure reaction creates guest accounts in the background when guests create carts
@willmoss1000
William Moss
@willmoss1000
Oct 26 2018 20:18
@hairychris I don't think so since 1.3. Anonymous users have an anonymousAcessToken the accountId will be null
@zenweasel what is the purpose of cartCleanupJob? Looking at 1.10 it looks like it should: remove all carts for the user, and if the users account doesn't have an email set also remove the account. It doesn't look to me like it currently achieves this?
Hairy Chris
@hairychris
Oct 26 2018 21:06
that makes sense thanks for explaining