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

[BUG] build-config incompatible for openshift target #1875

Open
tbugfinder opened this issue May 17, 2024 · 0 comments
Open

[BUG] build-config incompatible for openshift target #1875

tbugfinder opened this issue May 17, 2024 · 0 comments
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@tbugfinder
Copy link

Expected Behavior

setting in buildconfig
apiVersion: build.openshift.io/v1

Actual Behavior

setting in buildconfig:
apiVersion: v1

Steps To Reproduce

kompose convert -f compose.yaml --provider=openshift --build build-config
oc apply -f api-buildconfig.yaml

Kompose Version

1.33.0 (3ce457399)

Docker-Compose file

# Docker Compose file for preview environment and building docker images in pipelines

services:

  # Database service for local development
  database:
    build:
      args:
        NEO4J_IMAGE: ${NEO4J_IMAGE:-neo4j:5.10.0-enterprise}
        PYTHON_IMAGE: ${PYTHON_IMAGE:-python:3.11.3-slim}
        NEO4J_server_memory_heap_initial__size: "2G"
        NEO4J_server_memory_heap_max__size: "2G"
        NEO4J_server_memory_pagecache_size: "1G"
        CDISC_DATA_DIR: ${CDISC_DATA_DIR:-mdr_standards_import/container_booting/}
        NEO4J_MDR_AUTH_PASSWORD: "${NEO4J_PASSWORD:-changeme1234}"
        UID: ${UID:-1000}
      context: ./
      dockerfile: database.Dockerfile
    environment:
      NEO4J_ACCEPT_LICENSE_AGREEMENT: "yes"
      NEO4J_server_memory_heap_initial__size: "2G"
      NEO4J_server_memory_heap_max__size: "2G"
      NEO4J_server_memory_pagecache_size: "1G"
      NEO4J_server_default__listen__address: "0.0.0.0"
      NEO4J_server_default__advertised__address: "localhost"
      NEO4J_server_bolt_advertised__address: "localhost:5002"
      NEO4J_server_http_advertised__address: "localhost:5001"
    ports:
      - "${BIND_ADDRESS:-127.0.0.1}:${NEO4J_BOLT_PORT:-5002}:7687"
      - "${BIND_ADDRESS:-127.0.0.1}:${NEO4J_HTTP_PORT:-5001}:7474"
    volumes:
      - type: volume
        source: data
        target: /data
      # For database dumps, you can mount a folder into the container ex.:
      #- ./neo4j-dumps:/data/dumps

  # API image & service, distinct build stages for production and development
  api:
    build:
      context: ./clinical-mdr-api
      dockerfile: Dockerfile
      args:
        UVICORN_PORT: 5003
        UVICORN_ROOT_PATH: "/api"
        PYTHON_IMAGE: ${PYTHON_IMAGE:-python:3.11.3-slim}
        TARGET: ${BUILD_TARGET:-dev}
    image: ${API_IMAGE:-}
    depends_on:
      database:
        condition: service_healthy
    environment:
      NEO4J_DSN: "${NEO4J_DSN:-bolt://neo4j:changeme1234@database:7687/mdrdb}"
      ALLOW_ORIGIN_REGEX: "${ALLOW_ORIGIN_REGEX:-.*}"
      OAUTH_ENABLED: "${OAUTH_ENABLED:-False}"
      OAUTH_RBAC_ENABLED: "${OAUTH_RBAC_ENABLED:-False}"
      OAUTH_METADATA_URL: "${OAUTH_METADATA_URL:-}"
      OAUTH_API_APP_ID: "${OAUTH_API_APP_ID:-}"
      OAUTH_API_APP_SECRET: "${OAUTH_API_APP_SECRET:-}"
      OAUTH_SWAGGER_APP_ID: "${OAUTH_SWAGGER_APP_ID:-}"
      MS_GRAPH_INTEGRATION_ENABLED: "${MS_GRAPH_INTEGRATION_ENABLED:-}"
      MS_GRAPH_GROUPS_QUERY: "${MS_GRAPH_GROUPS_QUERY:-}"
      # deprecated #
      OAUTH_APP_ID: "${OAUTH_APP_ID:-}"
      OAUTH_APP_SECRET: "${OAUTH_APP_SECRET:-}"
      OAUTH_CLIENT_ID: "${OAUTH_CLIENT_ID:-}"
      OIDC_METADATA_DOCUMENT: "${OIDC_METADATA_DOCUMENT:-}"

  # Frontend image for production (see UI service for local development)
  frontend:
    build:
      args:
        NGINX_IMAGE: ${NGINX_IMAGE:-nginx:alpine}
        NODE_IMAGE: ${NODE_IMAGE:-node:lts-alpine}
      context: ./studybuilder
      dockerfile: Dockerfile
    image: ${FRONTEND_IMAGE:-}
    depends_on:
      # Nginx reverse-proxy configuration requires downstream services to be ready at startup
      api:
        condition: service_healthy
      documentation:
        condition: service_healthy
      neodash:
        condition: service_healthy
    ports:
      - "${BIND_ADDRESS:-127.0.0.1}:${FRONTEND_PORT:-5005}:5005"
    environment:
      API_BASE_URL: "${API_PATH:-}"
      DOC_BASE_URL: "${DOC_PATH:-}"
      NEODASH_BASE_URL: "${NEODASH_PATH:-}"
      OAUTH_ENABLED: "${OAUTH_ENABLED:-false}"
      OAUTH_METADATA_URL: "${OAUTH_METADATA_URL:-}"
      OAUTH_API_APP_ID: "${OAUTH_API_APP_ID:-}"
      OAUTH_UI_APP_ID: "${OAUTH_UI_APP_ID:-}"
      APPINSIGHTS_DISABLE: "true"

  # Documentation portal image for production (see docs service for local development)
  documentation:
    build:
      args:
        NGINX_IMAGE: ${NGINX_IMAGE:-nginx:alpine}
        NODE_IMAGE: ${NODE_IMAGE:-node:lts-alpine3.14}
      context: ./documentation-portal
      dockerfile: Dockerfile
    image: ${DOCUMENTATION_IMAGE:-}

  # Neodash service used with defined parameters
  neodash:
    image: neo4jlabs/neodash:latest
    depends_on:
      database:
        condition: service_healthy
    ports:
      - "${BIND_ADDRESS:-127.0.0.1}:${NEODASH_PORT:-5007}:5007"
    environment:
      - NGINX_PORT=5007
      - ssoEnabled=false
      - ssoDiscoveryUrl=https://localhost.com
      - standalone=true
      - standaloneProtocol=neo4j
      - standaloneHost=localhost
      - standalonePort=5002
      - standaloneDatabase=mdrdb
      - standaloneDashboardName=My dashboard
      - standaloneDashboardDatabase=neo4j
      - standaloneUsername=neo4j
      - standalonePassword=${NEO4J_PASSWORD:-changeme1234}


volumes:
  # Volume for storing the database on a local development environment
  data:
    name: studybuilder_database

Anything else?

Hello,
I'm also running into this issue using oc apply.
Openshift expects a proper apiVersion.

Steps:

kompose convert -f compose.yaml --provider=openshift --build build-config
grep apiVersion *buildconfig*
api-buildconfig.yaml:apiVersion: v1

oc apply -f api-buildconfig.yaml

error: resource mapping not found for name: "frontend" namespace: "" from "api-buildconfig.yaml": no matches for kind "BuildConfig" in version "v1"
ensure CRDs are installed first

Change apiVersion from v1 to openshift apiVersion: build.openshift.io/v1:

grep apiVersion *buildconfig*
api-buildconfig.yaml:apiVersion: build.openshift.io/v1

oc apply -f api-buildconfig.yaml
buildconfig.build.openshift.io/api created
oc version
Client Version: 4.13.0-202401292134.p0.g7780c37.assembly.stream-7780c37
Kustomize Version: v4.5.7
Kubernetes Version: v1.26.13+77e61a2
@tbugfinder tbugfinder added the kind/bug Categorizes issue or PR as related to a bug. label May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

No branches or pull requests

1 participant