Skip to content

Commit

Permalink
11.0.0.11-r2 update (#150)
Browse files Browse the repository at this point in the history
  • Loading branch information
IBMRob authored Mar 22, 2021
1 parent 9b964ab commit eb5f862
Show file tree
Hide file tree
Showing 28 changed files with 64 additions and 60 deletions.
2 changes: 1 addition & 1 deletion cmd/runaceserver/integrationserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
"github.com/ot4i/ace-docker/internal/command"
"github.com/ot4i/ace-docker/internal/name"
"github.com/ot4i/ace-docker/internal/qmgr"
"github.com/ot4i/ace-docker/internal/contentserver"
"github.com/ot4i/ace-docker/common/contentserver"
"gopkg.in/yaml.v2"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/runaceserver/logging.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"io/ioutil"
"os"

"github.com/ot4i/ace-docker/internal/logger"
"github.com/ot4i/ace-docker/common/logger"
)

var log logger.LoggerInterface
Expand Down
2 changes: 1 addition & 1 deletion cmd/runaceserver/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
"github.com/ot4i/ace-docker/internal/metrics"
"github.com/ot4i/ace-docker/internal/name"
"github.com/ot4i/ace-docker/internal/qmgr"
"github.com/ot4i/ace-docker/internal/designer"
"github.com/ot4i/ace-docker/common/designer"
)

func doMain() error {
Expand Down
2 changes: 1 addition & 1 deletion cmd/runaceserver/main_internal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"strconv"
"testing"

"github.com/ot4i/ace-docker/internal/logger"
"github.com/ot4i/ace-docker/common/logger"
)

var test *bool
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"net/http"
"io"

"github.com/ot4i/ace-docker/internal/logger"
"github.com/ot4i/ace-docker/common/logger"
)

var loadX509KeyPair = tls.LoadX509KeyPair
Expand Down Expand Up @@ -69,6 +69,7 @@ func GetBAR(url string, serverName string, token string, contentServerCACert []b
}
// TODO: this doesn't actually return an error
if response.StatusCode != 200 {
log.Printf("Call to retrieve BAR file from content server failed with response code: %v", response.StatusCode)
return nil, err
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
"io/ioutil"
"bytes"

"github.com/ot4i/ace-docker/internal/logger"
"github.com/ot4i/ace-docker/common/logger"

"github.com/stretchr/testify/assert"
"testing"
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
"gopkg.in/yaml.v2"

"github.com/ot4i/ace-docker/internal/command"
"github.com/ot4i/ace-docker/internal/logger"
"github.com/ot4i/ace-docker/common/logger"
)

var runAsUser = command.RunAsUser
Expand Down Expand Up @@ -140,27 +140,26 @@ func getConnectorLicenseToggleName(name string) string {
// findDisabledConnectorInFlow returns the first disabled connector it finds
// if it doesn't find a disabled connector, it returns an empty string
var findDisabledConnectorInFlow = func (flowDocument flowDocument, log logger.LoggerInterface) string {
disabledConnectors := make([]string, 0)

// read the connector-type field under each interface
// and check if the license toggle for that connector is enabled
findDisabledConnector := func (interfaces map[string]flowInterface) string {
findDisabledConnector := func(interfaces map[string]flowInterface) {
for _, i := range interfaces {
connector := i.ConnectorType
if connector != "" {
log.Printf("Checking if connector %v is supported under the current license.", connector)
if !isLicenseToggleEnabled(getConnectorLicenseToggleName(connector)) {
return connector
disabledConnectors = append(disabledConnectors, connector)
}
}
}
return ""
}

disabledTriggerConnector := findDisabledConnector(flowDocument.Integration.TriggerInterfaces)
if disabledTriggerConnector != "" {
return disabledTriggerConnector
}
disabledActionConnector := findDisabledConnector(flowDocument.Integration.ActionInterfaces)
return disabledActionConnector
findDisabledConnector(flowDocument.Integration.TriggerInterfaces)
findDisabledConnector(flowDocument.Integration.ActionInterfaces)

return strings.Join(disabledConnectors[:], ", ")
}

// IsFlowValid checks if a single flow is valid
Expand All @@ -172,11 +171,11 @@ var IsFlowValid = func(log logger.LoggerInterface, flow string, flowFile []byte)
return false, err
}

disabledConnector := findDisabledConnectorInFlow(flowDocument, log)
if disabledConnector != "" {
log.Errorf("Flow %v contains a %v connector, which isn't supported under the current license. Please update your license to enable this flow to run.", flow, disabledConnector)
disabledConnectors := findDisabledConnectorInFlow(flowDocument, log)
if disabledConnectors != "" {
log.Errorf("Flow %v contains one or more connectors, which aren't supported under the current license. Please update your license to enable this flow to run. The unsupported connectors are: %v.", flow, disabledConnectors)
}
return disabledConnector == "", nil
return disabledConnectors == "", nil
}

// ValidateFlows checks if the flows in the /run directory are valid
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"io"
"io/ioutil"

"github.com/ot4i/ace-docker/internal/logger"
"github.com/ot4i/ace-docker/common/logger"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
Expand Down Expand Up @@ -80,7 +80,8 @@ func TestFindDisabledConnectorInFlow(t *testing.T) {
},
},
}
require.Equal(t, "foo", findDisabledConnectorInFlow(testFlowDocument, testLogger))
disabledConnectors := findDisabledConnectorInFlow(testFlowDocument, testLogger)
require.Equal(t, "foo", disabledConnectors)
})

t.Run("When there are unsupported connectors in the action interface", func(t *testing.T) {
Expand All @@ -101,7 +102,8 @@ func TestFindDisabledConnectorInFlow(t *testing.T) {
},
},
}
require.Equal(t, "bar", findDisabledConnectorInFlow(testFlowDocument, testLogger))
disabledConnectors := findDisabledConnectorInFlow(testFlowDocument, testLogger)
require.Equal(t, "bar", disabledConnectors)
})

t.Run("When there are unsupported connectors in both the trigger interface and the action interface", func(t *testing.T) {
Expand All @@ -125,7 +127,8 @@ func TestFindDisabledConnectorInFlow(t *testing.T) {
},
},
}
require.Equal(t, "foo", findDisabledConnectorInFlow(testFlowDocument, testLogger))
disabledConnectors := findDisabledConnectorInFlow(testFlowDocument, testLogger)
require.Equal(t, "foo, bar", disabledConnectors)
})

isLicenseToggleEnabled = oldIsLicenseToggleEnabled
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"strings"
"testing"

"github.com/ot4i/ace-docker/internal/logger"
"github.com/ot4i/ace-docker/common/logger"
)

func TestJSONLogger(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion internal/command/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
"strings"
"syscall"

"github.com/ot4i/ace-docker/internal/logger"
"github.com/ot4i/ace-docker/common/logger"
)

// A BackgroundCmd provides a handle to a backgrounded command and its completion state.
Expand Down
2 changes: 1 addition & 1 deletion internal/configuration/configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"path/filepath"
"strings"

"github.com/ot4i/ace-docker/internal/logger"
"github.com/ot4i/ace-docker/common/logger"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime/schema"
Expand Down
2 changes: 1 addition & 1 deletion internal/configuration/configuration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"os"
"testing"

"github.com/ot4i/ace-docker/internal/logger"
"github.com/ot4i/ace-docker/common/logger"
"github.com/stretchr/testify/assert"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/client-go/dynamic"
Expand Down
2 changes: 1 addition & 1 deletion internal/configuration/techConnectorsConfiguration.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

"github.com/aymerick/raymond"
"github.com/ghodss/yaml"
"github.com/ot4i/ace-docker/internal/logger"
"github.com/ot4i/ace-docker/common/logger"
)

// Credentials structure for jdbc credentials object, can be extended for other tech connectors
Expand Down
2 changes: 1 addition & 1 deletion internal/metrics/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ limitations under the License.
package metrics

import (
"github.com/ot4i/ace-docker/internal/logger"
"github.com/ot4i/ace-docker/common/logger"

"github.com/prometheus/client_golang/prometheus"
)
Expand Down
2 changes: 1 addition & 1 deletion internal/metrics/exporter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (

"github.com/prometheus/client_golang/prometheus"
dto "github.com/prometheus/client_model/go"
"github.com/ot4i/ace-docker/internal/logger"
"github.com/ot4i/ace-docker/common/logger"
)

func getTestLogger() logger.LoggerInterface {
Expand Down
2 changes: 1 addition & 1 deletion internal/metrics/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"net/http"
"time"

"github.com/ot4i/ace-docker/internal/logger"
"github.com/ot4i/ace-docker/common/logger"

"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
Expand Down
2 changes: 1 addition & 1 deletion internal/metrics/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import (
"strings"
"sync"

"github.com/ot4i/ace-docker/internal/logger"
"github.com/ot4i/ace-docker/common/logger"

"github.com/gorilla/websocket"
"github.com/prometheus/client_golang/prometheus"
Expand Down
2 changes: 1 addition & 1 deletion internal/qmgr/qmgr.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"time"

"github.com/ot4i/ace-docker/internal/command"
"github.com/ot4i/ace-docker/internal/logger"
"github.com/ot4i/ace-docker/common/logger"
)

// UseQueueManager returns a boolean for whether or not the system is using a queue manager.
Expand Down
4 changes: 2 additions & 2 deletions sample/Dockerfile.aceonly
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ USER root
COPY bars_aceonly /home/aceuser/bars
RUN chmod -R ugo+rwx /home/aceuser

USER aceuser
USER 1000

RUN ace_compile_bars.sh

USER root

RUN chmod -R ugo+rwx /home/aceuser

USER aceuser
USER 1000
4 changes: 3 additions & 1 deletion ubi/Dockerfile.acemq
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@ RUN go mod download

COPY cmd/ ./cmd
COPY internal/ ./internal
COPY common/ ./common
RUN go build -ldflags "-X \"main.ImageCreated=$(date --iso-8601=seconds)\" -X \"main.ImageRevision=$IMAGE_REVISION\" -X \"main.ImageSource=$IMAGE_SOURCE\"" ./cmd/runaceserver/
RUN go build ./cmd/chkaceready/
RUN go build ./cmd/chkacehealthy/
# Run all unit tests
RUN go test -v ./cmd/runaceserver/
RUN go test -v ./internal/...
RUN go vet ./cmd/... ./internal/...
RUN go test -v ./common/...
RUN go vet ./cmd/... ./internal/... ./common/...

ARG ACE_INSTALL=ace-11.0.0.8.tar.gz
WORKDIR /opt/ibm
Expand Down
28 changes: 14 additions & 14 deletions ubi/Dockerfile.aceonly
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ RUN go mod download

COPY cmd/ ./cmd
COPY internal/ ./internal
COPY common/ ./common
RUN go version
RUN go build -ldflags "-X \"main.ImageCreated=$(date --iso-8601=seconds)\" -X \"main.ImageRevision=$IMAGE_REVISION\" -X \"main.ImageSource=$IMAGE_SOURCE\"" ./cmd/runaceserver/
RUN go build ./cmd/chkaceready/
Expand All @@ -18,7 +19,8 @@ RUN go build ./cmd/chkacehealthy/
# Run all unit tests
RUN go test -v ./cmd/runaceserver/
RUN go test -v ./internal/...
RUN go vet ./cmd/... ./internal/...
RUN go test -v ./common/...
RUN go vet ./cmd/... ./internal/... ./common/...

ARG ACE_INSTALL=ace-11.0.0.8.tar.gz
ARG IFIX_LIST=""
Expand Down Expand Up @@ -55,16 +57,16 @@ LABEL summary="$SUMMARY" \
# Add required license as text file in Liceses directory (GPL, MIT, APACHE, Partner End User Agreement, etc)
COPY /licenses/ /licenses/

RUN microdnf update && microdnf install findutils util-linux unzip python3 tar procps openssl && microdnf clean all \
&& ln -s /usr/bin/python3 /usr/local/bin/python \
&& mkdir /etc/ACEOpenTracing /opt/ACEOpenTracing /var/log/ACEOpenTracing && chmod 777 /var/log/ACEOpenTracing /etc/ACEOpenTracing

# Create OpenTracing directories, update permissions and copy in any library or configuration files needed
RUN mkdir /etc/ACEOpenTracing /opt/ACEOpenTracing /var/log/ACEOpenTracing && chmod 777 /var/log/ACEOpenTracing /etc/ACEOpenTracing
COPY deps/OpenTracing/library/* ./opt/ACEOpenTracing/
COPY deps/OpenTracing/config/* ./etc/ACEOpenTracing/

WORKDIR /opt/ibm

RUN microdnf update && microdnf install findutils util-linux unzip python3 tar procps && microdnf clean all

RUN ln -s /usr/bin/python3 /usr/local/bin/python
COPY --from=builder /opt/ibm/ace-11 /opt/ibm/ace-11

# Copy in PID1 process
Expand All @@ -79,6 +81,10 @@ COPY ubi/install-kubectl.sh /usr/local/bin/
RUN chmod u+x /usr/local/bin/install-kubectl.sh \
&& install-kubectl.sh

COPY ubi/generic_invalid/invalid_license.msgflow /home/aceuser/temp/gen
COPY ubi/generic_invalid/InvalidLicenseJava.jar /home/aceuser/temp/gen
COPY ubi/generic_invalid/application.descriptor /home/aceuser/temp

# Create a user to run as, create the ace workdir, and chmod script files
RUN /opt/ibm/ace-11/ace make registry global accept license silently \
&& useradd -u 1000 -d /home/aceuser -G mqbrkrs,wheel aceuser \
Expand All @@ -87,14 +93,8 @@ RUN /opt/ibm/ace-11/ace make registry global accept license silently \
&& su - -c '. /opt/ibm/ace-11/server/bin/mqsiprofile && mqsicreateworkdir /home/aceuser/ace-server' \
&& chmod -R 777 /home/aceuser \
&& chmod -R 777 /var/mqsi \
&& su - -c '. /opt/ibm/ace-11/server/bin/mqsiprofile && echo $MQSI_JREPATH && chmod g+w $MQSI_JREPATH/lib/security/cacerts'

RUN mkdir /home/aceuser/temp
RUN mkdir /home/aceuser/temp/gen
COPY ubi/generic_invalid/invalid_license.msgflow /home/aceuser/temp/gen
COPY ubi/generic_invalid/InvalidLicenseJava.jar /home/aceuser/temp/gen
COPY ubi/generic_invalid/application.descriptor /home/aceuser/temp
RUN chmod -R 777 /home/aceuser/temp
&& su - -c '. /opt/ibm/ace-11/server/bin/mqsiprofile && echo $MQSI_JREPATH && chmod g+w $MQSI_JREPATH/lib/security/cacerts' \
&& chmod -R 777 /home/aceuser/temp

# Set BASH_ENV to source mqsiprofile when using docker exec bash -c
ENV BASH_ENV=/usr/local/bin/ace_env.sh
Expand All @@ -107,7 +107,7 @@ WORKDIR /home/aceuser
ENV LOG_FORMAT=basic

# Set user to prevent container running as root by default
USER aceuser
USER 1000

# Set entrypoint to run management script

Expand Down
6 changes: 3 additions & 3 deletions ubi/Dockerfile.connectors
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ RUN mkdir -p /opt/ibm/ace-11/node_modules
COPY deps/package-connectors.json /opt/ibm/ace-11/package.json
RUN export PATH=$PATH:/opt/ibm/ace-11/common/node/bin \
&& cd /opt/ibm/ace-11/node_modules \
&& npm install loopback-connector-mongodb loopback-connector-postgresql --save
RUN chown -R aceuser:mqbrkrs /opt/ibm/ace-11/node_modules
&& npm install loopback-connector-mongodb loopback-connector-postgresql --save \
&& chown -R aceuser:mqbrkrs /opt/ibm/ace-11/node_modules

USER aceuser
USER 1000
11 changes: 5 additions & 6 deletions ubi/Dockerfile.mqclient
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,13 @@ COPY ubi/install-mq-client-prereqs.sh /usr/local/bin/
RUN chmod u+x /usr/local/bin/install-*.sh \
&& sleep 1 \
&& install-mq-client-prereqs.sh $MQM_UID \
&& install-mq.sh $MQM_UID

RUN mkdir /home/aceuser/truststores
&& install-mq.sh $MQM_UID \
&& mkdir /home/aceuser/truststores
COPY --from=truststore-builder /tmp/mqcacerts.kdb /home/aceuser/truststores/mqcacerts.kdb
RUN chmod -R 777 /home/aceuser/truststores
RUN chmod -R 777 /home/aceuser/truststores \
# Set the integration server to use it by default. A user provided server.conf.yaml will override this behaviour if the mqKeyRepository property is set.
RUN sed -i 's/#.*mqKeyRepository:.*/mqKeyRepository: \/home\/aceuser\/truststores\/mqcacerts/g' /home/aceuser/ace-server/server.conf.yaml
&& sed -i 's/#.*mqKeyRepository:.*/mqKeyRepository: \/home\/aceuser\/truststores\/mqcacerts/g' /home/aceuser/ace-server/server.conf.yaml

ENV MQCERTLABL=aceclient

USER aceuser
USER 1000
Binary file modified ubi/generic_invalid/InvalidLicenseJava.jar
Binary file not shown.

0 comments on commit eb5f862

Please sign in to comment.