diff --git a/ai-service/Dockerfile b/ai-service/Dockerfile index 59ac1c81de..35deadbb69 100644 --- a/ai-service/Dockerfile +++ b/ai-service/Dockerfile @@ -1,6 +1,6 @@ # syntax=docker/dockerfile:1 # Stage 0: Use node image for base image for all stages -ARG NODE_VERSION=20.11.1-alpine +ARG NODE_VERSION=20.16-alpine FROM node:${NODE_VERSION} as base WORKDIR /usr/local/app # Define an argument `YARN_CACHE_FOLDER` for the Yarn cache directory @@ -10,9 +10,9 @@ ARG YARN_CACHE_FOLDER=/root/.yarn FROM base as interfaces COPY --link interfaces/package.json interfaces/tsconfig*.json yarn.lock ./ COPY --link interfaces/src src/ -# Here and after. Leverage a cache mount to /root/.yarn to speed up subsequent builds -RUN --mount=type=cache,target=/root/.yarn \ - yarn install --frozen-lockfile && yarn pack +# Here and after. Leverage a cache mount to `YARN_CACHE_FOLDER` to speed up subsequent builds +RUN --mount=type=cache,target=${YARN_CACHE_FOLDER} \ + yarn install --immutable && yarn pack # Stage 2: Build common module FROM base as common @@ -20,7 +20,7 @@ COPY --link --from=interfaces /usr/local/app/guardian-interfaces-*.tgz /tmp/inte COPY --link common/package.json common/tsconfig*.json yarn.lock ./ COPY --link common/src src/ RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/interfaces']='file:/tmp/interfaces.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" -RUN --mount=type=cache,target=/root/.yarn \ +RUN --mount=type=cache,target=${YARN_CACHE_FOLDER} \ yarn install && yarn pack # Stage 3: Installing production dependecies @@ -29,7 +29,7 @@ COPY --link --from=interfaces /usr/local/app/guardian-interfaces-*.tgz /tmp/inte COPY --link --from=common /usr/local/app/guardian-common-*.tgz /tmp/common.tgz COPY --link ai-service/package.json ai-service/tsconfig*.json yarn.lock ./ RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/interfaces']='file:/tmp/interfaces.tgz'; input.dependencies['@guardian/common']='file:/tmp/common.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" -RUN --mount=type=cache,target=/root/.yarn,sharing=private \ +RUN --mount=type=cache,target=${YARN_CACHE_FOLDER},sharing=private \ yarn install --prod # Stage 4: Build service @@ -38,8 +38,8 @@ COPY --link --from=interfaces /usr/local/app/guardian-interfaces-*.tgz /tmp/inte COPY --link --from=common /usr/local/app/guardian-common-*.tgz /tmp/common.tgz COPY --link --from=deps /usr/local/app/package.json /usr/local/app/tsconfig*.json /usr/local/app/yarn.lock ./ COPY --link ai-service/src src/ -RUN --mount=type=cache,target=/root/.yarn \ - yarn install --frozen-lockfile && yarn run build:prod +RUN --mount=type=cache,target=${YARN_CACHE_FOLDER} \ + yarn install --immutable && yarn run build:prod # Stage 5: Create the final image FROM base as image diff --git a/ai-service/data/generated-data/ACM0001.txt b/ai-service/data/generated-data/ACM0001.txt deleted file mode 100644 index 605b5325ff..0000000000 --- a/ai-service/data/generated-data/ACM0001.txt +++ /dev/null @@ -1,20 +0,0 @@ -Methodology name: ACM0001 (Flaring or use of landfill gas) - -Typical project(s): Capture of landfill gas (LFG) and its flaring and/or use to produce energy and/or use to -supply consumers through natural gas distribution network or trucks - -Type of GHG emissions mitigation action: -GHG destruction. -Destruction of methane emissions and displacement of a more-GHG-intensive service - -Important conditions under which the methodology is applicable: -• Captured landfill gas is flared, and/or; -• Captured landfill gas is used to produce energy, and or; -• Captured gas is used to supply consumers through natural gas distribution network, -trucks or the dedicated pipeline. - -Important parameters: -Monitored: -• Amount of landfill gas captured; -• Methane fraction in the landfill gas; -• If applicable: electricity generation using landfill gas. \ No newline at end of file diff --git a/ai-service/faiss-vector/docstore.json b/ai-service/faiss-vector/docstore.json deleted file mode 100644 index 6bfcab8f8d..0000000000 --- a/ai-service/faiss-vector/docstore.json +++ /dev/null @@ -1,582 +0,0 @@ -[ - [ - [ - "d33b8e79-c6c8-43c0-aea1-4660e7d87b81", - { - "pageContent": "Methodology name: ACM0001 (Flaring or use of landfill gas)\r\n\r\nTypical project(s): Capture of landfill gas (LFG) and its flaring and/or use to produce energy and/or use to\r\nsupply consumers through natural gas distribution network or trucks\r\n\r\nType of GHG emissions mitigation action: \r\nGHG destruction.\r\nDestruction of methane emissions and displacement of a more-GHG-intensive service\r\n\r\nImportant conditions under which the methodology is applicable: \r\n• Captured landfill gas is flared, and/or;\r\n• Captured landfill gas is used to produce energy, and or;\r\n• Captured gas is used to supply consumers through natural gas distribution network,\r\ntrucks or the dedicated pipeline.\r\n\r\nImportant parameters: \r\nMonitored:\r\n• Amount of landfill gas captured;\r\n• Methane fraction in the landfill gas;\r\n• If applicable: electricity generation using landfill gas.", - "metadata": { - "source": "C:\\_BS\\MyProjects\\unfccc-demo\\backend\\short-descriptions\\ACM0001.txt", - "loc": { - "lines": { - "from": 1, - "to": 20 - } - } - } - } - ], - [ - "2c4f947c-aada-4d79-990b-83206cbf7bd0", - { - "pageContent": "Methodology name: ACM0002 (Grid-connected electricity generation from renewable sources)\r\n\r\nTypical project(s):\r\nRetrofit, rehabilitation (or refurbishment), replacement or capacity addition of an\r\nexisting power plant or construction and operation of a new power plant/unit that uses\r\nrenewable energy sources and supplies electricity to the grid.\r\nBattery energy storage system can be integrated under certain conditions.\r\nType of GHG emissions mitigation action: \r\n• Renewable energy.\r\nDisplacement of electricity that would be provided to the grid by more-GHG-intensive means.\r\n\r\nImportant conditions under which the methodology is applicable:\r\n• The project power plant is using one of the following sources: hydro, wind, geothermal,\r\nsolar, wave or tidal power. Biomass-fired power plants are not applicable;\r\n• In the case of capacity additions, retrofits, rehabilitation or replacements, the existing\r\npower plant started commercial operation prior to the start of a minimum historical", - "metadata": { - "source": "C:\\_BS\\MyProjects\\unfccc-demo\\backend\\short-descriptions\\ACM0002.txt", - "loc": { - "lines": { - "from": 1, - "to": 16 - } - } - } - } - ], - [ - "3e98927e-e844-4800-8806-973bd0ef70fe", - { - "pageContent": "reference period of five years, and no capacity expansion or retrofit, rehabilitation or\r\nreplacement of the plant has been undertaken between the start of this minimum\r\nhistorical reference period and the implementation of the project;\r\n• In case of hydro power:\r\n– The project has to be implemented in an existing reservoir, with no change in\r\nthe volume of reservoir;\r\n– The project has to be implemented in an existing reservoir, where the volume of\r\nreservoir is increased and the power density is greater than 4 W/m2;\r\n– The project results in new reservoirs and the power density is greater than 4 W/m2; or\r\n– The project activity is an integrated hydro power project involving multiple reservoirs;\r\n• Integration with a Battery Energy Storage System is possible for a Greenfield\r\nrenewable energy generation technology or an existing solar photovoltaic or wind\r\npower plant.\r\n\r\nImportant parameters:\r\n\r\nAt validation:\r\n• Grid emission factor (can also be monitored ex post).\r\n\r\nMonitored:", - "metadata": { - "source": "C:\\_BS\\MyProjects\\unfccc-demo\\backend\\short-descriptions\\ACM0002.txt", - "loc": { - "lines": { - "from": 17, - "to": 36 - } - } - } - } - ], - [ - "176756f3-3ebe-4234-9ad7-16fb9963aea7", - { - "pageContent": "Monitored:\r\n• Electricity supplied to the grid by the project;\r\n• If applicable: methane emissions of the project.", - "metadata": { - "source": "C:\\_BS\\MyProjects\\unfccc-demo\\backend\\short-descriptions\\ACM0002.txt", - "loc": { - "lines": { - "from": 36, - "to": 38 - } - } - } - } - ], - [ - "40493714-9f46-474c-81c3-79b7d44deb62", - { - "pageContent": "Methodology name: ACM0006 (Electricity and heat generation from biomass)\r\n\r\nTypical project(s):\r\nGeneration of power and heat in thermal power plants, including cogeneration plants\r\nusing biomass. Typical activities are new plant, capacity expansion, energy efficiency\r\nimprovements or fuel switch projects.\r\n\r\nType of GHG emissions mitigation action:\r\n• Renewable energy;\r\n• Energy efficiency;\r\n• Fuel switch;\r\n• GHG emission avoidance.\r\nDisplacement of more-GHG-intensive electricity generation in grid or heat and\r\nelectricity generation on-site. Avoidance of methane emissions from anaerobic decay\r\nof biomass residues.\r\n\r\nImportant conditions under which the methodology is applicable:\r\n• Only power and heat or cogeneration plants are applicable;\r\n• Only biomass residues, biogas and biomass from dedicated plantations are eligible;\r\n• Fossil fuels may be co-fired in the project plant. The amount of fossil fuels co-fired\r\nshall not exceed 80% of the total fuel fired on an energy basis;", - "metadata": { - "source": "C:\\_BS\\MyProjects\\unfccc-demo\\backend\\short-descriptions\\ACM0006.txt", - "loc": { - "lines": { - "from": 1, - "to": 21 - } - } - } - } - ], - [ - "c1545415-9520-495e-bd95-fedebe30b578", - { - "pageContent": "• Planted biomass is eligible if specific conditions elaborated in “Project and leakage\r\nemissions from biomass” are met.\r\n\r\nImportant parameters At validation:\r\n• Grid emission factor (can also be monitored ex post).\r\nMonitored:\r\n• Quantity and moisture content of the biomass used in the project activity;\r\n• Electricity and heat generated in the project activity;\r\n• Electricity and, if applicable, fossil fuel consumption of the project activity.", - "metadata": { - "source": "C:\\_BS\\MyProjects\\unfccc-demo\\backend\\short-descriptions\\ACM0006.txt", - "loc": { - "lines": { - "from": 22, - "to": 30 - } - } - } - } - ], - [ - "37cc46b9-8de2-4c4e-9da5-b48b7dfb3b86", - { - "pageContent": "Methodology name: ACM0007 (Conversion from single cycle to combined cycle power generation)\r\n\r\nTypical project(s): \r\nConversion from an open-cycle gas power plant to a combined-cycle gas power plant.\r\n\r\nType of GHG emissions mitigation action:\r\n• Energy efficiency.\r\nFuel savings through energy efficiency improvement.\r\n\r\nImportant conditions under which the methodology is applicable:\r\n• The project does not increase the lifetime of the existing gas turbine\r\nor engine during the crediting period;\r\n• Waste heat generated on the project site is not utilizable for any\r\nother purpose.\r\n\r\nImportant parameters:\r\nAt validation:\r\n• Electricity generation of the existing open-cycle gas power plant (can also be\r\nmonitored ex post);\r\n• Fuel consumption of the existing open-cycle gas power plant.\r\nMonitored:\r\n• Electricity generation of the combined-cycle gas power plant;\r\n• Fuel consumption of the combined-cycle gas power plant;\r\n• Grid emission factor", - "metadata": { - "source": "C:\\_BS\\MyProjects\\unfccc-demo\\backend\\short-descriptions\\ACM0007.txt", - "loc": { - "lines": { - "from": 1, - "to": 24 - } - } - } - } - ], - [ - "02ce7845-d7b7-4b44-8291-54ef39591328", - { - "pageContent": "Methodology name: ACM0018 (Electricity generation from biomass in power-only plants)\r\n\r\nTypical project(s):\r\nGeneration of power using biomass as fuel, in new biomass based power plants at sites\r\nwhere currently no power generation occurs (Greenfield), replacement or installation\r\nof operation units next to existing power plants (capacity expansion projects), energy\r\nefficiency improvement projects or replacement of fossil fuel by biomass in existing\r\npower plants (fuel switch projects). The biomass based power generation may be\r\ncombined with solar thermal power generation.\r\n\r\nType of GHG emissions mitigation action\r\n• Renewable energy;\r\n• Energy efficiency;\r\n• Fuel switch.\r\nDisplacement of more GHG-intensive electricity generation in the grid or on-site.\r\nAvoidance of methane emissions from anaerobic decay of biomass residues.\r\nDisplacement of more-GHG-intensive fossil fuel for combustion in stationary installations.\r\n\r\nImportant conditions under which the methodology is applicable:", - "metadata": { - "source": "C:\\_BS\\MyProjects\\unfccc-demo\\backend\\short-descriptions\\ACM0018.txt", - "loc": { - "lines": { - "from": 1, - "to": 19 - } - } - } - } - ], - [ - "29f37e7b-9e47-41ee-a112-1819c9d6334b", - { - "pageContent": "• If biomass from a production process is used, the implementation of the project\r\nshall not result in an increase of the processing capacity of raw input;\r\n• The methodology is applicable to power-only plants;\r\n• Planted biomass is eligible if specific conditions elaborated in “Project and leakage\r\nemissions from biomass” are met;\r\n• Fossil fuels may be co-fired in the project plant. However, the amount of fossil\r\nfuels co-fired shall not exceed 80% of the total fuel fired on an energy basis;\r\n• In case of existing facilities, three years of historical data is required for the\r\ncalculation of emissions reductions;\r\n• Projects that chemically process the biomass prior to combustion\r\n(e.g. by means of esterification of waste oils, fermentation and gasification, etc.)\r\nare not eligible under this methodology. The biomass can however be processed\r\nphysically such as by means of drying, pelletization, shredding and briquetting.\r\n\r\nImportant parameters: \r\nAt validation:", - "metadata": { - "source": "C:\\_BS\\MyProjects\\unfccc-demo\\backend\\short-descriptions\\ACM0018.txt", - "loc": { - "lines": { - "from": 20, - "to": 35 - } - } - } - } - ], - [ - "aaff152a-f798-4e0d-8b8c-5a7b14dfad7e", - { - "pageContent": "Important parameters: \r\nAt validation:\r\n• If applicable: grid emission factor (can also be monitored ex post).\r\nMonitored:\r\n• Electricity generated in the project;\r\n• Quantity and moisture content of the biomass used in the project and electricity and\r\nfossil fuel consumption of the project.", - "metadata": { - "source": "C:\\_BS\\MyProjects\\unfccc-demo\\backend\\short-descriptions\\ACM0018.txt", - "loc": { - "lines": { - "from": 35, - "to": 41 - } - } - } - } - ], - [ - "a8d93f4d-0ff5-48ed-85eb-8f7221195bb5", - { - "pageContent": "Methodology name: AMS-I.A (Electricity generation by the user)\r\n\r\nTypical project(s): \r\nRenewable electricity generation such as solar, hydro, wind or biomass gasification\r\nare implemented by the users as new installations (Greenfield) or replacement of\r\nexisting onsite fossil-fuel-fired generation.\r\n\r\nType of GHG emissions mitigation action\r\n• Renewable energy.\r\nDisplacement of more-GHG-intensive, non-renewable electricity applications by\r\nintroducing renewable energy technologies.\r\n\r\nImportant conditions under which the methodology is applicable:\r\n• Users are in off-grid locations, i.e. they do not have connection to a national/\r\nregional grid, unless exceptional situations, e.g. weak grids;\r\n• Users are included in the project boundary;\r\n• Conditions apply for reservoir-based hydro plants.\r\n\r\nImportant parameters:\r\nAt validation:\r\n• Trend-adjusted projection of historical fuel consumption if an existing technology\r\nis replaced (e.g. for lighting, daily use duration can be applied).", - "metadata": { - "source": "C:\\_BS\\MyProjects\\unfccc-demo\\backend\\short-descriptions\\AMS-I.A.txt", - "loc": { - "lines": { - "from": 1, - "to": 22 - } - } - } - } - ], - [ - "683c9082-1ddb-4e59-9154-d3a906dae413", - { - "pageContent": "Monitored:\r\n• An annual check of all systems or a sample thereof to ensure that they are still\r\noperating, or metering of generated electricity;\r\n• If applicable, consumption of energy sources (e.g. biomass, fossil fuel);\r\n• If applicable, availability of connected grid.", - "metadata": { - "source": "C:\\_BS\\MyProjects\\unfccc-demo\\backend\\short-descriptions\\AMS-I.A.txt", - "loc": { - "lines": { - "from": 23, - "to": 27 - } - } - } - } - ], - [ - "0b3176aa-9c16-4253-859b-4ffe069b0b2d", - { - "pageContent": "Methodology name: AMS-I.C (Thermal energy production with or without electricity)\r\n\r\nTypical project(s): \r\nThermal energy production using renewable energy sources including biomass-based\r\ncogeneration and/or trigeneration. Projects that seek to retrofit or modify existing facilities\r\nfor renewable energy generation are also applicable.\r\n\r\nType of GHG emissions mitigation action\r\n• Renewable energy.\r\nDisplacement of more-GHG-intensive thermal energy production, displacement of\r\nmore-GHG-intensive thermal energy and/or electricity generation.\r\n\r\nImportant conditions under which the methodology is applicable\r\n• Thermal energy and/or electricity production using biomass-based cogeneration\r\nand trigeneration system is eligible;\r\n• If solid biomass is used, it has to be demonstrated that solely renewable biomass\r\nis used. If charcoal or biomass fuel is used, all project or leakage emissions\r\n(e.g. release of methane) from the fuel production have to be considered;", - "metadata": { - "source": "C:\\_BS\\MyProjects\\unfccc-demo\\backend\\short-descriptions\\AMS-I.C.txt", - "loc": { - "lines": { - "from": 1, - "to": 18 - } - } - } - } - ], - [ - "7f6ad657-b6a6-4663-93b4-c2d45a640a54", - { - "pageContent": "• If project equipment contains refrigerants, then the refrigerant used in the project\r\ncase shall have no ozone depleting potential (ODP).\r\n\r\nImportant parameters Monitored:\r\n• The moisture content of biomass of homogeneous quality may be fixed ex ante\r\nor monitored for each batch of biomass if the emission reductions are calculated\r\nbased on energy input;\r\n• Thermal energy (mass flow, temperature, pressure for heat/cooling) delivered\r\nby the project and the amount of grid and/or captive electricity displaced;\r\n• Quantity of biomass and fossil fuel consumed;\r\n• Net calorific value of biomass shall be determined once in the first year of\r\nthe crediting period;\r\n• The chilled water mass flow-rate for chiller(s);\r\n• Cooling output of baseline chiller displaced as a result of the installation of project\r\nactivity;\r\n• Quantity of refrigerant used to replace refrigerant that has leaked.", - "metadata": { - "source": "C:\\_BS\\MyProjects\\unfccc-demo\\backend\\short-descriptions\\AMS-I.C.txt", - "loc": { - "lines": { - "from": 19, - "to": 34 - } - } - } - } - ], - [ - "2a38e243-a1e6-4e64-8605-3000918e91f5", - { - "pageContent": "Methodology name: AMS-I.F (Renewable electricity generation for captive use and mini-grid)\r\n\r\nTypical project(s): \r\nProduction of electricity using renewable energy technologies such as photovoltaic, hydro,\r\ntidal/wave, wind, geothermal and renewable biomass that supply electricity to user(s).\r\n\r\nType of GHG emissions mitigation action:\r\n• Renewable energy.\r\nDisplacement of electricity that would be provided to the user(s) by more-GHGintensive means.\r\n\r\nImportant conditions under which the methodology is applicable\r\n• The project will displace electricity from an electricity distribution system that is or\r\nwould have been supplied by at least one fossil fuel fired generating unit;\r\n• Electricity is produced by installing a new power plant (Greenfield) or by capacity\r\naddition/retrofit/replacement of (an) existing plant(s);\r\n• Special conditions apply for reservoir-based hydro plants;\r\n• Cogeneration projects are not eligible.\r\n\r\nImportant parameters: \r\nAt validation:", - "metadata": { - "source": "C:\\_BS\\MyProjects\\unfccc-demo\\backend\\short-descriptions\\AMS-I.F.txt", - "loc": { - "lines": { - "from": 1, - "to": 20 - } - } - } - } - ], - [ - "145cf39a-52d2-4a72-b8a7-92c0865ee5a6", - { - "pageContent": "Important parameters: \r\nAt validation:\r\n• If applicable: grid emission factor (can also be monitored ex post).\r\nMonitored:\r\n• Net electricity generation, quantity of fossil fuel and biomass consumption.", - "metadata": { - "source": "C:\\_BS\\MyProjects\\unfccc-demo\\backend\\short-descriptions\\AMS-I.F.txt", - "loc": { - "lines": { - "from": 20, - "to": 24 - } - } - } - } - ], - [ - "7898bd2a-3c1a-497e-b62b-374c0f17aade", - { - "pageContent": "Methodology name: AMS-II.G (Energy efficiency measures in thermal applications of non-renewable biomass)\r\n\r\nTypical project(s): \r\nIntroduction of new efficient thermal energy generation units, e.g. efficient biomass fired\r\ncook stoves or ovens or dryers or retrofitting of existing units to reduce the use of\r\nnonrenewable biomass for combustion.\r\n\r\nType of GHG emissions mitigation action\r\n• Energy efficiency.\r\nDisplacement or energy efficiency enhancement of existing heat generation units results\r\nin saving of non-renewable biomass and reduction of GHG emissions.\r\n\r\nImportant conditions under which the methodology is applicable:\r\n• It shall be demonstrated that non-renewable biomass has been used since 31\r\nDecember 1989;\r\n• The methodology is applicable to single pot or multi pot portable or in-situ cook\r\nstoves with rated efficiency of at least 25 per cent.\r\n\r\nImportant parameters:\r\nMonitored:\r\n• Annual or biennial check of operation of the project appliances (e.g. by", - "metadata": { - "source": "C:\\_BS\\MyProjects\\unfccc-demo\\backend\\short-descriptions\\AMS-II.G.txt", - "loc": { - "lines": { - "from": 1, - "to": 21 - } - } - } - } - ], - [ - "ef650358-59bc-4152-bf22-550370a8b027", - { - "pageContent": "representative sample);\r\n• Annual check of the efficiency of the project appliances (e.g. by representative\r\nsample). Other options to determine efficiency include a sample survey of the\r\ndevices in the first batch and applying default annual efficiency drop values;\r\n• Fraction of woody biomass saved by the project activity that can be established as\r\nnon-renewable biomass, as per the methodological tool “Calculation of fraction of\r\nnon-renewable biomass”;\r\n• Leakage: the amount of woody biomass saved under the project that is used by\r\nnon-project households/users (who previously used renewable energy sources)\r\nshall be assessed from surveys", - "metadata": { - "source": "C:\\_BS\\MyProjects\\unfccc-demo\\backend\\short-descriptions\\AMS-II.G.txt", - "loc": { - "lines": { - "from": 22, - "to": 31 - } - } - } - } - ], - [ - "60c868a2-36f9-4e6d-be86-5613142203ba", - { - "pageContent": "Methodology name: AMS-II.J (Demand-side activities for efficient lighting technologies)\r\n\r\nTypical project(s): \r\nActivities for adoption of energy efficient light bulbs (e.g. CFLs and LED lamps) to replace\r\nless efficient light bulbs in residential applications.\r\n\r\nType of GHG emissions mitigation action\r\n• Energy efficiency.\r\nDisplacement of more-GHG-intensive lighting by technology switch.\r\n\r\nImportant conditions under which the methodology is applicable:\r\n• Total light output of the project lamp should be equal to or more than that of the\r\nbaseline lamp being replaced and project lamps shall, in addition to the standard\r\nlamp specifications, be marked for clear unique identification for the project;\r\n• Rated average life of the efficient light bulbs shall be known ex ante and the CDM\r\nPDD shall cite the standard used by the manufacturer;\r\n• Determination of daily operating hours: either default value of 3.5 hours or\r\nmeasured value.\r\n\r\nImportant parameters: \r\nAt validation:", - "metadata": { - "source": "C:\\_BS\\MyProjects\\unfccc-demo\\backend\\short-descriptions\\AMS-II.J.txt", - "loc": { - "lines": { - "from": 1, - "to": 21 - } - } - } - } - ], - [ - "606cdec8-c104-4c41-bec9-c8352e985784", - { - "pageContent": "Important parameters: \r\nAt validation:\r\n• Average life time of the project lamp (can also be monitored ex post);\r\n• The number and power of the replaced baseline lamps;\r\n• Number of project lamps distributed under the project,\r\nidentified by the type of project lamps and the date of supply;\r\n• Grid emission factor (can also be monitored ex post).\r\nMonitored:\r\n• If applicable: measurement of average daily operating hours;\r\n• Lamp failure rate surveys.", - "metadata": { - "source": "C:\\_BS\\MyProjects\\unfccc-demo\\backend\\short-descriptions\\AMS-II.J.txt", - "loc": { - "lines": { - "from": 21, - "to": 30 - } - } - } - } - ], - [ - "785d36dc-3e38-4e1a-8ac2-32b2285afee1", - { - "pageContent": "AMS-III.AR (Substituting fossil fuel based lighting with LED/CFL lighting systems)\r\n\r\nTypical project(s): \r\nActivities that replace portable fossil fuel based lamps (e.g. wick-based kerosene lanterns)\r\nwith battery-charged LED or CFL based lighting systems in residential and/or non-residential\r\napplications (e.g. ambient lights, task lights, portable lights).\r\n\r\nType of GHG emissions mitigation action:\r\n• Renewable energy;\r\n• Energy efficiency.\r\nDisplacement of more-GHG-intensive service (lighting).\r\n\r\nImportant conditions under which the methodology is applicable:\r\n• Project lamps whose batteries are through:\r\n– A renewable energy system (e.g. a photovoltaic system or mechanical system\r\nsuch as a hand crank charger);\r\n– A standalone distributed generation system (e.g. a diesel generator set) or a\r\nmini-grid;\r\n– A grid that is connected to regional/national grid;\r\n– A combination of the above options;\r\n• When the LED/CFL lighting system has more than one LED/ CFL lamp connected to", - "metadata": { - "source": "C:\\_BS\\MyProjects\\unfccc-demo\\backend\\short-descriptions\\AMS-III.AR.txt", - "loc": { - "lines": { - "from": 1, - "to": 21 - } - } - } - } - ], - [ - "f45af351-218f-4be7-a8e8-b2367332572c", - { - "pageContent": "a single rechargeable battery system, each LED/CFL lamp may be considered as one\r\nproject lamp;\r\n• At a minimum, project lamps shall be certified by their manufacturer to have a rated\r\naverage operational life of at least:\r\n– 5,000 hours where project lamps are assumed to operate for two years after\r\ndistribution to end-users (i.e. emission reductions are not credited beyond\r\ntwo years). Under this option, ex post monitoring surveys to determine the\r\npercentage of project lamps in service in year y are not required;\r\n– 10,000 hours where project lamps are assumed to operate for up to seven years\r\nafter distribution to end-users (i.e. emission reductions are not credited beyond\r\nseven years). Under this option, more stringent requirements (e.g. test on light\r\noutput, ex post monitoring surveys) are specified;\r\n• Project lamps shall have a minimum of one year warranty;\r\n• The replaced baseline lamps are those that directly consume fossil fuel.\r\n\r\nImportant parameters: \r\nMonitored:", - "metadata": { - "source": "C:\\_BS\\MyProjects\\unfccc-demo\\backend\\short-descriptions\\AMS-III.AR.txt", - "loc": { - "lines": { - "from": 22, - "to": 38 - } - } - } - } - ], - [ - "710dea23-1ef2-4e22-8dd7-107fa4232cef", - { - "pageContent": "Important parameters: \r\nMonitored:\r\n• Recording of project lamp distribution data;\r\n• In some cases, ex post monitoring surveys to determine percentage of project lamps\r\ndistributed to end users that are operating and in service in year y.", - "metadata": { - "source": "C:\\_BS\\MyProjects\\unfccc-demo\\backend\\short-descriptions\\AMS-III.AR.txt", - "loc": { - "lines": { - "from": 38, - "to": 42 - } - } - } - } - ], - [ - "a244ac6c-83bd-4314-8777-029451cd865e", - { - "pageContent": "Methodology name: AMS-III.AV (Low greenhouse gas emitting safe drinking water production systems)\r\n\r\nTypical project(s): \r\nProject activities that introduce low GHG emitting water purification systems to provide safe\r\ndrinking water and displace water boiling using non-renewable biomass or fossil fuels.\r\nWater kiosks that treat water using one or more of the following technologies: chlorination,\r\ncombined flocculant/disinfection powders and solar disinfection are also eligible.\r\n\r\nType of GHG emissions mitigation action:\r\nDisplacement of a more-GHG-intensive output.\r\n\r\nImportant conditions under which the methodology is applicable:\r\n• Prior to the implementation of the project activity, a public distribution network\r\nsupplying safe drinking water to the project boundary does not exist;\r\n• The application of the project technology/equipment shall achieve compliance either\r\nwith: (i) the comprehensive protection performance target as per “Evaluating household", - "metadata": { - "source": "C:\\_BS\\MyProjects\\unfccc-demo\\backend\\short-descriptions\\AMS-III.AV.txt", - "loc": { - "lines": { - "from": 1, - "to": 16 - } - } - } - } - ], - [ - "0d6116dc-0cab-4e26-8237-be57fd8bce02", - { - "pageContent": "water treatment options: Health based targets and microbiological performance\r\nspecifications” (WHO, 2011); or (ii) an applicable national standard or guideline;\r\n• In cases where the life span of the water treatment technologies is shorter than\r\nthe crediting period of the project activity, there shall be documented measures in\r\nplace to ensure that end users have access to replacement purification systems of\r\ncomparable quality.\r\n\r\nImportant parameters: \r\nMonitored:\r\n• Checking of appliances to ensure that they are still operating or are replaced by\r\nan equivalent;\r\n• Quantity of purified water;\r\n• Annual check if a safe drinking water public distribution network is installed;\r\n• Safe drinking water quality;\r\n• Total electricity and fossil fuel consumption by the project activity.", - "metadata": { - "source": "C:\\_BS\\MyProjects\\unfccc-demo\\backend\\short-descriptions\\AMS-III.AV.txt", - "loc": { - "lines": { - "from": 17, - "to": 31 - } - } - } - } - ], - [ - "51a3ce07-23fd-4cf3-9ebf-718f34f407e4", - { - "pageContent": "Methodology name: AMS-III.BB (Electrification of communities through grid extension or construction of new mini-grids)\r\n\r\nTypical project(s): \r\nThe project activity supplies electricity to consumers who, prior to project implementation,\r\nwere not connected to a national/regional grid and were supplied by a high-carbonintensive mini-grid or stand-alone power generators. Also fuel-based lighting systems\r\nmight have been used before the project implementation.\r\n\r\nType of GHG emissions mitigation action:\r\n• Displacement of more-GHG-intensive output.\r\nLow-carbon-intensive grid/mini-grid electricity displaces high-carbon-intensive\r\nelectricity or lighting services.\r\n\r\nImportant conditions under which the methodology is applicable:\r\n• Limited to communities with no access to a national or regional grid;\r\n• At least 75% of the end users (by number) shall be households.\r\n\r\nImportant parameters: \r\nAt validation:\r\n• The physical location of each consumer and the anticipated connected load and", - "metadata": { - "source": "C:\\_BS\\MyProjects\\unfccc-demo\\backend\\short-descriptions\\AMS-III.BB.txt", - "loc": { - "lines": { - "from": 1, - "to": 19 - } - } - } - } - ], - [ - "9c98da05-1378-4649-97e4-407cca168041", - { - "pageContent": "usage hours of each consumer.\r\nMonitored:\r\n• Metering of total electricity delivered to consumers (e.g. at a substation). Prepaid\r\ndevices for purchase of electricity can also be used for the purpose of metering;\r\n• Metering of electricity consumption of all non-household end users (e.g. commercial\r\nconsumers, SMMEs, public institutions, street lighting, irrigation pumps) and\r\nhousehold end-users expected to consume more than 1000 kWh/year.", - "metadata": { - "source": "C:\\_BS\\MyProjects\\unfccc-demo\\backend\\short-descriptions\\AMS-III.BB.txt", - "loc": { - "lines": { - "from": 20, - "to": 26 - } - } - } - } - ], - [ - "cf339c7a-55f4-46b1-af42-109aa303330a", - { - "pageContent": "Methodology name: AMS-III.D (Methane recovery in animal manure management systems)\r\n\r\nTypical project(s): \r\nReplacement or modification of existing anaerobic manure management systems in\r\nlivestock farms, or treatment of manure collected from several farms in a centralized plant\r\nto achieve methane recovery and destruction by flaring/combustion or energetic use of\r\nthe recovered methane.\r\n\r\nType of GHG emissions mitigation action:\r\n• GHG destruction.\r\nGHG destruction and displacement of more-GHG-intensive service.\r\n\r\nImportant conditions under which the methodology is applicable:\r\n• Manure or the streams obtained after treatment are not discharged into natural\r\nwater resources (e.g. river or estuaries);\r\n• In the baseline scenario the retention time of manure waste in the anaerobic\r\ntreatment system is greater than one month, and in case of anaerobic lagoons\r\nin the baseline, their depths are at least 1 m;\r\n• Final sludge must be handled aerobically;", - "metadata": { - "source": "C:\\_BS\\MyProjects\\unfccc-demo\\backend\\short-descriptions\\AMS-III.D.txt", - "loc": { - "lines": { - "from": 1, - "to": 19 - } - } - } - } - ], - [ - "498285aa-1875-40ad-871b-84427c70b53d", - { - "pageContent": "• Final sludge must be handled aerobically;\r\n• The storage time of the manure after removal from the animal barns, including\r\ntransportation, should not exceed 45 days before being fed into the anaerobic\r\ndigester, unless it can be demonstrated that the dry matter content of the manure\r\nwhen removed from the animal barns is more than 20%.\r\n\r\nImportant parameters: \r\nMonitored:\r\n• Amount of biogas recovered and fuelled, flared or used gainfully;\r\n• The annual amount of fossil fuel or electricity used to operate the facility or\r\nauxiliary equipment;\r\n• Fraction of the manure handled in the manure management system;\r\n• Proper soil application (not resulting in methane emissions) of the final sludge\r\nmust be monitored.", - "metadata": { - "source": "C:\\_BS\\MyProjects\\unfccc-demo\\backend\\short-descriptions\\AMS-III.D.txt", - "loc": { - "lines": { - "from": 19, - "to": 32 - } - } - } - } - ], - [ - "2a7307c9-0201-40c7-bb66-daf4e9800983", - { - "pageContent": "Methodology name: AMS-III.F (Avoidance of methane emissions through composting)\r\n\r\nTypical project(s): \r\nControlled biological treatment of biomass or other organic matter is introduced through\r\naerobic treatment by composting and proper soil application of the compost.\r\n\r\nType of GHG emissions mitigation action:\r\n• GHG emission avoidance.\r\nAvoidance of GHG emissions by alternative treatment process.\r\n\r\nImportant conditions under which the methodology is applicable:\r\n• Recovery and combustion of landfill gas is not eligible;\r\n• Identified landfill(s) should be able to accommodate the waste to be used for the\r\nproject for the duration of the crediting period; or it is common practice in the region\r\nto dispose of the waste in solid waste disposal sites (landfills).\r\n\r\nImportant parameters: \r\nMonitored:\r\n• Quantity of waste biologically treated and its composition through representative\r\nsampling;\r\n• When project includes co-treating of wastewater, the volume of co-treated", - "metadata": { - "source": "C:\\_BS\\MyProjects\\unfccc-demo\\backend\\short-descriptions\\AMS-III.F.txt", - "loc": { - "lines": { - "from": 1, - "to": 21 - } - } - } - } - ], - [ - "5645c010-133e-4b66-ace9-23df05ac2156", - { - "pageContent": "wastewater and its COD content through representative sampling;\r\n• Annual amount of fossil fuel or electricity used to operate the facilities or\r\nauxiliary equipment.", - "metadata": { - "source": "C:\\_BS\\MyProjects\\unfccc-demo\\backend\\short-descriptions\\AMS-III.F.txt", - "loc": { - "lines": { - "from": 22, - "to": 24 - } - } - } - } - ], - [ - "93c01827-7753-4d98-801b-fbcf558c777b", - { - "pageContent": "Methodology name: AMS-III.H (Methane recovery in wastewater treatment)\r\n\r\nTypical project(s): \r\nRecovery of biogas resulting from anaerobic decay of organic matter in wastewaters\r\nthrough introduction of anaerobic treatment system for wastewater and/or sludge\r\ntreatment.\r\n\r\nType of GHG emissions mitigation action\r\n• GHG destruction.\r\nDestruction of methane emissions and displacement of more-GHG-intensive service.\r\n\r\nImportant conditions under which the methodology is applicable:\r\n• Anaerobic lagoons should be deeper than 2 metres, without aeration, ambient\r\ntemperature above 15°C, at least during part of the year, on a monthly average\r\nbasis. The minimum interval between two consecutive sludge removal events shall\r\nbe 30 days;\r\n• In determining baseline emissions, historical records of at least one year prior\r\nto the project implementation shall be available. Otherwise, a representative\r\nmeasurement campaign is required.\r\n\r\nImportant parameters: \r\nAt validation:", - "metadata": { - "source": "C:\\_BS\\MyProjects\\unfccc-demo\\backend\\short-descriptions\\AMS-III.H.txt", - "loc": { - "lines": { - "from": 1, - "to": 22 - } - } - } - } - ], - [ - "75a4ac84-3422-4ac9-a6ea-6943ebefd13a", - { - "pageContent": "Important parameters: \r\nAt validation:\r\n• COD removal efficiency of the baseline system.\r\nMonitored:\r\n• Flow of wastewater;\r\n• Chemical oxygen demand of the wastewater before and after the treatment system;\r\n• Amount of sludge as dry matter in each sludge treatment system;\r\n• Amount of biogas recovered, fuelled, flared or utilized (e.g. injected into a natural\r\ngas distribution grid or distributed via a dedicated piped network).", - "metadata": { - "source": "C:\\_BS\\MyProjects\\unfccc-demo\\backend\\short-descriptions\\AMS-III.H.txt", - "loc": { - "lines": { - "from": 22, - "to": 30 - } - } - } - } - ], - [ - "fe7f0f3a-1051-4481-928a-45b1079d3b8e", - { - "pageContent": "Categorization Methodologies by Scale\r\n\r\n1. Large-Scale: ACM0001, ACM0002, ACM0006, ACM0007, ACM0018\r\n2. Small-Scale: AMS-I.A, AMS-I.C, AMS-I.F, AMS-II.G, AMS-II.J, AMS-III.AR, AMS-III.AV, AMS-III.BB, AMS-III.D, AMS-III.F, AMS-III.H\r\n\r\nCategorization Methodologies by Applied Technology Type/Measure\r\n\r\n1. Landfill gas: ACM0001\r\n2. Grid electricity: ACM0002\r\n3. Biomass electricity: ACM0006, ACM0018\r\n4. Energy efficiency: ACM0007\r\n5. Offgrid electricity/ isolated grids: AMS-I.A\r\n6. Renewable thermal energy: AMS-I.C\r\n7. Captive power: AMS-I.F\r\n8. Cookstove: AMS-II.G\r\n9. Lighting: AMS-II.J, AMS-III.AR\r\n10. Water purifier: AMS-III.AV\r\n11. Electricity grid connection: AMS-III.BB\r\n12. Manure and comparable animal waste: AMS-III.D\r\n13. Alternative treatment – composting: AMS-III.F\r\n14. Lagoons and biodigester – biogas: AMS-III.H\r\n\r\nCategorization Methodologies by Mitigation Activity Type\r\n\r\n1. GHG destruction: ACM0001, AMS-III.D, AMS-III.H", - "metadata": { - "source": "C:\\_BS\\MyProjects\\unfccc-demo\\backend\\short-descriptions\\metadata.txt", - "loc": { - "lines": { - "from": 1, - "to": 25 - } - } - } - } - ], - [ - "4f7fce7a-9e42-48a5-b41c-c5ecc9aec77d", - { - "pageContent": "2. Renewable energy: ACM0002, ACM0006, ACM0018, AMS-I.A, AMS-I.C, AMS-I.F, AMS-III.AR\r\n3. Energy efficiency: ACM0006, ACM0007, ACM0018, AMS-II.G, AMS-II.J, AMS-III.AR, AMS-III.AV, AMS-III.BB\r\n4. Fuel/feedstock switch: ACM0006, ACM0018, AMS-III.BB\r\n5. GHG emission avoidance: AMS-III.F\r\n\r\nCategorization Methodologies by Sub Type\r\n\r\n1. Electricity generation and supply: ACM0002, ACM0006, ACM0007, ACM0018, AMS-I.A, AMS-I.C, AMS-I.F, AMS-III.BB\r\n2. Energy for industries: ACM0006, ACM0018, AMS-I.C, AMS-I.F, AMS-II.G\r\n3. Energy for households and buildings: AMS-I.A, AMS-I.C, AMS-I.F, AMS-II.G, AMS-II.J, AMS-III.AR, AMS-III.AV\r\n\r\nMethodologies Sectoral Scope Name\r\n\r\n1. Waste handling and disposal: ACM0001, AMS-III.D, AMS-III.F, AMS-III.H\r\n2. Energy industries (renewable-/ non renewable sources: ACM0002, ACM0006, ACM0007, ACM0018, AMS-I.A, AMS-I.C, AMS-I.F\r\n3. Energy demand: AMS-II.G, AMS-II.J, AMS-III.AR, AMS-III.AV\r\n4. Energy distribution: AMS-III.BB\r\n\r\nSectoral Scope Number:", - "metadata": { - "source": "C:\\_BS\\MyProjects\\unfccc-demo\\backend\\short-descriptions\\metadata.txt", - "loc": { - "lines": { - "from": 26, - "to": 44 - } - } - } - } - ], - [ - "710b8bc7-b60b-4bad-8192-5ef1bee56080", - { - "pageContent": "Sectoral Scope Number:\r\nWaste handling and disposal: 13\r\nEnergy industries (renewable-/ non renewable sources): 1\r\nEnergy demand: 3\r\nEnergy distribution: 2", - "metadata": { - "source": "C:\\_BS\\MyProjects\\unfccc-demo\\backend\\short-descriptions\\metadata.txt", - "loc": { - "lines": { - "from": 44, - "to": 48 - } - } - } - } - ] - ], - { - "0": "d33b8e79-c6c8-43c0-aea1-4660e7d87b81", - "1": "2c4f947c-aada-4d79-990b-83206cbf7bd0", - "2": "3e98927e-e844-4800-8806-973bd0ef70fe", - "3": "176756f3-3ebe-4234-9ad7-16fb9963aea7", - "4": "40493714-9f46-474c-81c3-79b7d44deb62", - "5": "c1545415-9520-495e-bd95-fedebe30b578", - "6": "37cc46b9-8de2-4c4e-9da5-b48b7dfb3b86", - "7": "02ce7845-d7b7-4b44-8291-54ef39591328", - "8": "29f37e7b-9e47-41ee-a112-1819c9d6334b", - "9": "aaff152a-f798-4e0d-8b8c-5a7b14dfad7e", - "10": "a8d93f4d-0ff5-48ed-85eb-8f7221195bb5", - "11": "683c9082-1ddb-4e59-9154-d3a906dae413", - "12": "0b3176aa-9c16-4253-859b-4ffe069b0b2d", - "13": "7f6ad657-b6a6-4663-93b4-c2d45a640a54", - "14": "2a38e243-a1e6-4e64-8605-3000918e91f5", - "15": "145cf39a-52d2-4a72-b8a7-92c0865ee5a6", - "16": "7898bd2a-3c1a-497e-b62b-374c0f17aade", - "17": "ef650358-59bc-4152-bf22-550370a8b027", - "18": "60c868a2-36f9-4e6d-be86-5613142203ba", - "19": "606cdec8-c104-4c41-bec9-c8352e985784", - "20": "785d36dc-3e38-4e1a-8ac2-32b2285afee1", - "21": "f45af351-218f-4be7-a8e8-b2367332572c", - "22": "710dea23-1ef2-4e22-8dd7-107fa4232cef", - "23": "a244ac6c-83bd-4314-8777-029451cd865e", - "24": "0d6116dc-0cab-4e26-8237-be57fd8bce02", - "25": "51a3ce07-23fd-4cf3-9ebf-718f34f407e4", - "26": "9c98da05-1378-4649-97e4-407cca168041", - "27": "cf339c7a-55f4-46b1-af42-109aa303330a", - "28": "498285aa-1875-40ad-871b-84427c70b53d", - "29": "2a7307c9-0201-40c7-bb66-daf4e9800983", - "30": "5645c010-133e-4b66-ace9-23df05ac2156", - "31": "93c01827-7753-4d98-801b-fbcf558c777b", - "32": "75a4ac84-3422-4ac9-a6ea-6943ebefd13a", - "33": "fe7f0f3a-1051-4481-928a-45b1079d3b8e", - "34": "4f7fce7a-9e42-48a5-b41c-c5ecc9aec77d", - "35": "710b8bc7-b60b-4bad-8192-5ef1bee56080" - } -] diff --git a/ai-service/faiss-vector/faiss.index b/ai-service/faiss-vector/faiss.index deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/analytics-service/Dockerfile b/analytics-service/Dockerfile index 6c454d4b98..1d0d6328e3 100644 --- a/analytics-service/Dockerfile +++ b/analytics-service/Dockerfile @@ -1,6 +1,6 @@ # syntax=docker/dockerfile:1 # Stage 0: Use node image for base image for all stages -ARG NODE_VERSION=20.11.1-alpine +ARG NODE_VERSION=20.16-alpine FROM node:${NODE_VERSION} as base WORKDIR /usr/local/app # Define an argument `YARN_CACHE_FOLDER` for the Yarn cache directory @@ -10,9 +10,9 @@ ARG YARN_CACHE_FOLDER=/root/.yarn FROM base as interfaces COPY --link interfaces/package.json interfaces/tsconfig*.json yarn.lock ./ COPY --link interfaces/src src/ -# Here and after. Leverage a cache mount to /root/.yarn to speed up subsequent builds -RUN --mount=type=cache,target=/root/.yarn \ - yarn install --frozen-lockfile && yarn pack +# Here and after. Leverage a cache mount to `YARN_CACHE_FOLDER` to speed up subsequent builds +RUN --mount=type=cache,target=${YARN_CACHE_FOLDER} \ + yarn install --immutable && yarn pack # Stage 2: Build common module FROM base as common @@ -20,7 +20,7 @@ COPY --link --from=interfaces /usr/local/app/guardian-interfaces-*.tgz /tmp/inte COPY --link common/package.json common/tsconfig*.json yarn.lock ./ COPY --link common/src src/ RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/interfaces']='file:/tmp/interfaces.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" -RUN --mount=type=cache,target=/root/.yarn \ +RUN --mount=type=cache,target=${YARN_CACHE_FOLDER} \ yarn install && yarn pack # Stage 3: Installing production dependecies @@ -29,7 +29,7 @@ COPY --link --from=interfaces /usr/local/app/guardian-interfaces-*.tgz /tmp/inte COPY --link --from=common /usr/local/app/guardian-common-*.tgz /tmp/common.tgz COPY --link analytics-service/package.json analytics-service/tsconfig*.json yarn.lock ./ RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/interfaces']='file:/tmp/interfaces.tgz'; input.dependencies['@guardian/common']='file:/tmp/common.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" -RUN --mount=type=cache,target=/root/.yarn,sharing=private \ +RUN --mount=type=cache,target=${YARN_CACHE_FOLDER} \ yarn install --prod # Stage 4: Build service @@ -38,8 +38,8 @@ COPY --link --from=interfaces /usr/local/app/guardian-interfaces-*.tgz /tmp/inte COPY --link --from=common /usr/local/app/guardian-common-*.tgz /tmp/common.tgz COPY --link --from=deps /usr/local/app/package.json /usr/local/app/tsconfig*.json /usr/local/app/yarn.lock ./ COPY --link analytics-service/src src/ -RUN --mount=type=cache,target=/root/.yarn \ - yarn install --frozen-lockfile && yarn run build:prod +RUN --mount=type=cache,target=${YARN_CACHE_FOLDER} \ + yarn install --immutable && yarn run build:prod # Stage 5: Create the final image FROM base as image diff --git a/analytics-service/configs/.env.analytics b/analytics-service/configs/.env.analytics index bc06359f2b..7fad0073e0 100644 --- a/analytics-service/configs/.env.analytics +++ b/analytics-service/configs/.env.analytics @@ -6,8 +6,6 @@ DIRECT_MESSAGE_PORT="6558" # Ecosystem Defined Variables HEDERA_NET="testnet" PREUSED_HEDERA_NET="testnet" -JWT_PRIVATE_KEY="..." -JWT_PUBLIC_KEY="..." MQ_ADDRESS="localhost" DB_HOST="localhost" MQ_MAX_PAYLOAD="1048576" @@ -37,4 +35,4 @@ SEQ_API_KEY="" #MONGO_INIT MIN_POOL_SIZE="1" MAX_POOL_SIZE="5" -MAX_IDLE_TIME_MS="30000" \ No newline at end of file +MAX_IDLE_TIME_MS="30000" diff --git a/analytics-service/configs/.env.analytics.develop b/analytics-service/configs/.env.analytics.develop index bc06359f2b..7fad0073e0 100644 --- a/analytics-service/configs/.env.analytics.develop +++ b/analytics-service/configs/.env.analytics.develop @@ -6,8 +6,6 @@ DIRECT_MESSAGE_PORT="6558" # Ecosystem Defined Variables HEDERA_NET="testnet" PREUSED_HEDERA_NET="testnet" -JWT_PRIVATE_KEY="..." -JWT_PUBLIC_KEY="..." MQ_ADDRESS="localhost" DB_HOST="localhost" MQ_MAX_PAYLOAD="1048576" @@ -37,4 +35,4 @@ SEQ_API_KEY="" #MONGO_INIT MIN_POOL_SIZE="1" MAX_POOL_SIZE="5" -MAX_IDLE_TIME_MS="30000" \ No newline at end of file +MAX_IDLE_TIME_MS="30000" diff --git a/analytics-service/configs/.env.analytics.template b/analytics-service/configs/.env.analytics.template index 2316c87c54..f93b8d060a 100644 --- a/analytics-service/configs/.env.analytics.template +++ b/analytics-service/configs/.env.analytics.template @@ -6,8 +6,6 @@ DIRECT_MESSAGE_PORT="6558" # Ecosystem Defined Variables HEDERA_NET="" PREUSED_HEDERA_NET="" -JWT_PRIVATE_KEY="..." -JWT_PUBLIC_KEY="..." MQ_ADDRESS="" DB_HOST="" MQ_MAX_PAYLOAD="" diff --git a/api-gateway/Dockerfile b/api-gateway/Dockerfile index 937d56dde3..8e6b3615de 100644 --- a/api-gateway/Dockerfile +++ b/api-gateway/Dockerfile @@ -1,6 +1,6 @@ # syntax=docker/dockerfile:1 # Stage 0: Use node image for base image for all stages -ARG NODE_VERSION=20.11.1-alpine +ARG NODE_VERSION=20.16-alpine FROM node:${NODE_VERSION} as base WORKDIR /usr/local/app # Define an argument `YARN_CACHE_FOLDER` for the Yarn cache directory @@ -10,9 +10,9 @@ ARG YARN_CACHE_FOLDER=/root/.yarn FROM base as interfaces COPY --link interfaces/package.json interfaces/tsconfig*.json yarn.lock ./ COPY --link interfaces/src src/ -# Here and after. Leverage a cache mount to /root/.yarn to speed up subsequent builds -RUN --mount=type=cache,target=/root/.yarn \ - yarn install --frozen-lockfile && yarn pack +# Here and after. Leverage a cache mount to `YARN_CACHE_FOLDER` to speed up subsequent builds +RUN --mount=type=cache,target=${YARN_CACHE_FOLDER} \ + yarn install --immutable && yarn pack # Stage 2: Build common module FROM base as common @@ -20,7 +20,7 @@ COPY --link --from=interfaces /usr/local/app/guardian-interfaces-*.tgz /tmp/inte COPY --link common/package.json common/tsconfig*.json yarn.lock ./ COPY --link common/src src/ RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/interfaces']='file:/tmp/interfaces.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" -RUN --mount=type=cache,target=/root/.yarn \ +RUN --mount=type=cache,target=${YARN_CACHE_FOLDER} \ yarn install && yarn pack # Stage 3: Installing production dependecies @@ -29,7 +29,7 @@ COPY --link --from=interfaces /usr/local/app/guardian-interfaces-*.tgz /tmp/inte COPY --link --from=common /usr/local/app/guardian-common-*.tgz /tmp/common.tgz COPY --link api-gateway/package.json api-gateway/tsconfig*.json api-gateway/Gulpfile.mjs yarn.lock ./ RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/interfaces']='file:/tmp/interfaces.tgz'; input.dependencies['@guardian/common']='file:/tmp/common.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" -RUN --mount=type=cache,target=/root/.yarn,sharing=private \ +RUN --mount=type=cache,target=${YARN_CACHE_FOLDER},sharing=private \ yarn install --prod # Stage 4: Build service @@ -39,8 +39,8 @@ COPY --link --from=common /usr/local/app/guardian-common-*.tgz /tmp/common.tgz COPY --link --from=deps /usr/local/app/package.json /usr/local/app/tsconfig*.json /usr/local/app/Gulpfile.mjs /usr/local/app/yarn.lock ./ COPY --link api-gateway/environments environments/ COPY --link api-gateway/src src/ -RUN --mount=type=cache,target=/root/.yarn \ - yarn install --frozen-lockfile && yarn run build:prod +RUN --mount=type=cache,target=${YARN_CACHE_FOLDER} \ + yarn install --immutable && yarn run build:prod # Stage 5: Create the final image FROM base as image diff --git a/api-gateway/Dockerfile.demo b/api-gateway/Dockerfile.demo index be27d1c868..94b7b2887e 100644 --- a/api-gateway/Dockerfile.demo +++ b/api-gateway/Dockerfile.demo @@ -1,6 +1,6 @@ # syntax=docker/dockerfile:1 # Stage 0: Use node image for base image for all stages -ARG NODE_VERSION=20.11.1-alpine +ARG NODE_VERSION=20.16-alpine FROM node:${NODE_VERSION} as base WORKDIR /usr/local/app # Define an argument `YARN_CACHE_FOLDER` for the Yarn cache directory @@ -10,9 +10,9 @@ ARG YARN_CACHE_FOLDER=/root/.yarn FROM base as interfaces COPY --link interfaces/package.json interfaces/tsconfig*.json yarn.lock ./ COPY --link interfaces/src src/ -# Here and after. Leverage a cache mount to /root/.yarn to speed up subsequent builds -RUN --mount=type=cache,target=/root/.yarn \ - yarn install --frozen-lockfile && yarn pack +# Here and after. Leverage a cache mount to `YARN_CACHE_FOLDER` to speed up subsequent builds +RUN --mount=type=cache,target=${YARN_CACHE_FOLDER} \ + yarn install --immutable && yarn pack # Stage 2: Build common module FROM base as common @@ -20,7 +20,7 @@ COPY --link --from=interfaces /usr/local/app/guardian-interfaces-*.tgz /tmp/inte COPY --link common/package.json common/tsconfig*.json yarn.lock ./ COPY --link common/src src/ RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/interfaces']='file:/tmp/interfaces.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" -RUN --mount=type=cache,target=/root/.yarn \ +RUN --mount=type=cache,target=${YARN_CACHE_FOLDER} \ yarn install && yarn pack # Stage 3: Installing production dependecies @@ -29,7 +29,7 @@ COPY --link --from=interfaces /usr/local/app/guardian-interfaces-*.tgz /tmp/inte COPY --link --from=common /usr/local/app/guardian-common-*.tgz /tmp/common.tgz COPY --link api-gateway/package.json api-gateway/tsconfig*.json api-gateway/Gulpfile.mjs yarn.lock ./ RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/interfaces']='file:/tmp/interfaces.tgz'; input.dependencies['@guardian/common']='file:/tmp/common.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" -RUN --mount=type=cache,target=/root/.yarn,sharing=private \ +RUN --mount=type=cache,target=${YARN_CACHE_FOLDER},sharing=private \ yarn install --prod # Stage 4: Build service @@ -39,8 +39,8 @@ COPY --link --from=common /usr/local/app/guardian-common-*.tgz /tmp/common.tgz COPY --link --from=deps /usr/local/app/package.json /usr/local/app/tsconfig*.json /usr/local/app/Gulpfile.mjs /usr/local/app/yarn.lock ./ COPY --link api-gateway/environments environments/ COPY --link api-gateway/src src/ -RUN --mount=type=cache,target=/root/.yarn \ - yarn install --frozen-lockfile && yarn run build:demo +RUN --mount=type=cache,target=${YARN_CACHE_FOLDER} \ + yarn install --immutable && yarn run build:demo # Stage 5: Create the final image FROM base as image diff --git a/api-gateway/configs/.env.gateway b/api-gateway/configs/.env.gateway index 5832c775f3..fe2eeb6f74 100644 --- a/api-gateway/configs/.env.gateway +++ b/api-gateway/configs/.env.gateway @@ -6,8 +6,6 @@ DB_DATABASE="api-gateway" # Ecosystem Defined Variables HEDERA_NET="testnet" PREUSED_HEDERA_NET="testnet" -JWT_PRIVATE_KEY="..." -JWT_PUBLIC_KEY="..." MQ_ADDRESS="localhost" MRV_ADDRESS="http://localhost:3003/mrv" DB_HOST="localhost" @@ -36,4 +34,4 @@ SEQ_API_KEY="" #MONGO_INIT MIN_POOL_SIZE="1" MAX_POOL_SIZE="5" -MAX_IDLE_TIME_MS="30000" \ No newline at end of file +MAX_IDLE_TIME_MS="30000" diff --git a/api-gateway/configs/.env.gateway.develop b/api-gateway/configs/.env.gateway.develop index bc878766a8..8ac338b150 100644 --- a/api-gateway/configs/.env.gateway.develop +++ b/api-gateway/configs/.env.gateway.develop @@ -6,8 +6,6 @@ DB_DATABASE="api-gateway" # Ecosystem Defined Variables HEDERA_NET="testnet" PREUSED_HEDERA_NET="testnet" -JWT_PRIVATE_KEY="..." -JWT_PUBLIC_KEY="..." MQ_ADDRESS="localhost" MRV_ADDRESS="http://localhost:3003/mrv" DB_HOST="localhost" diff --git a/api-gateway/configs/.env.gateway.template b/api-gateway/configs/.env.gateway.template index 58e43bf030..02bcab2512 100644 --- a/api-gateway/configs/.env.gateway.template +++ b/api-gateway/configs/.env.gateway.template @@ -6,8 +6,6 @@ DB_DATABASE="" # Ecosystem Defined Variables HEDERA_NET="" PREUSED_HEDERA_NET="" -JWT_PRIVATE_KEY="..." -JWT_PUBLIC_KEY="..." MQ_ADDRESS="" MRV_ADDRESS="" DB_HOST="" diff --git a/application-events/Dockerfile b/application-events/Dockerfile index 2c45a3fb9a..dafb4572a9 100644 --- a/application-events/Dockerfile +++ b/application-events/Dockerfile @@ -1,6 +1,6 @@ # syntax=docker/dockerfile:1 # Stage 0: Use node image for base image for all stages -ARG NODE_VERSION=20.11.1-alpine +ARG NODE_VERSION=20.16-alpine FROM node:${NODE_VERSION} as base WORKDIR /usr/local/app # Define an argument `YARN_CACHE_FOLDER` for the Yarn cache directory @@ -10,9 +10,9 @@ ARG YARN_CACHE_FOLDER=/root/.yarn FROM base as interfaces COPY --link interfaces/package.json interfaces/tsconfig*.json yarn.lock ./ COPY --link interfaces/src src/ -# Here and after. Leverage a cache mount to /root/.yarn to speed up subsequent builds -RUN --mount=type=cache,target=/root/.yarn \ - yarn install --frozen-lockfile && yarn pack +# Here and after. Leverage a cache mount to `YARN_CACHE_FOLDER` to speed up subsequent builds +RUN --mount=type=cache,target=${YARN_CACHE_FOLDER} \ + yarn install --immutable && yarn pack # Stage 2: Build common module FROM base as common @@ -20,7 +20,7 @@ COPY --link --from=interfaces /usr/local/app/guardian-interfaces-*.tgz /tmp/inte COPY --link common/package.json common/tsconfig*.json yarn.lock ./ COPY --link common/src src/ RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/interfaces']='file:/tmp/interfaces.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" -RUN --mount=type=cache,target=/root/.yarn \ +RUN --mount=type=cache,target=${YARN_CACHE_FOLDER} \ yarn install && yarn pack # Stage 3: Installing production dependecies @@ -29,7 +29,7 @@ COPY --link --from=interfaces /usr/local/app/guardian-interfaces-*.tgz /tmp/inte COPY --link --from=common /usr/local/app/guardian-common-*.tgz /tmp/common.tgz COPY --link application-events/package.json application-events/tsconfig*.json yarn.lock ./ RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/interfaces']='file:/tmp/interfaces.tgz'; input.dependencies['@guardian/common']='file:/tmp/common.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" -RUN --mount=type=cache,target=/root/.yarn,sharing=private \ +RUN --mount=type=cache,target=${YARN_CACHE_FOLDER},sharing=private \ yarn install --prod # Stage 4: Build service @@ -38,8 +38,8 @@ COPY --link --from=interfaces /usr/local/app/guardian-interfaces-*.tgz /tmp/inte COPY --link --from=common /usr/local/app/guardian-common-*.tgz /tmp/common.tgz COPY --link --from=deps /usr/local/app/package.json /usr/local/app/tsconfig*.json /usr/local/app/yarn.lock ./ COPY --link application-events/src src/ -RUN --mount=type=cache,target=/root/.yarn \ - yarn install --frozen-lockfile && yarn run build:prod +RUN --mount=type=cache,target=${YARN_CACHE_FOLDER} \ + yarn install --immutable && yarn run build:prod # Stage 5: Create the final image FROM base as image diff --git a/auth-service/Dockerfile b/auth-service/Dockerfile index 463d367e22..823141b76c 100644 --- a/auth-service/Dockerfile +++ b/auth-service/Dockerfile @@ -1,6 +1,6 @@ # syntax=docker/dockerfile:1 # Stage 0: Use node image for base image for all stages -ARG NODE_VERSION=20.11.1-alpine +ARG NODE_VERSION=20.16-alpine FROM node:${NODE_VERSION} as base WORKDIR /usr/local/app # Define an argument `YARN_CACHE_FOLDER` for the Yarn cache directory @@ -10,9 +10,9 @@ ARG YARN_CACHE_FOLDER=/root/.yarn FROM base as interfaces COPY --link interfaces/package.json interfaces/tsconfig*.json yarn.lock ./ COPY --link interfaces/src src/ -# Here and after. Leverage a cache mount to /root/.yarn to speed up subsequent builds -RUN --mount=type=cache,target=/root/.yarn \ - yarn install --frozen-lockfile && yarn pack +# Here and after. Leverage a cache mount to speed up subsequent builds +RUN --mount=type=cache,target=${YARN_CACHE_FOLDER} \ + yarn install --immutable && yarn pack # Stage 2: Build common module FROM base as common @@ -20,7 +20,7 @@ COPY --link --from=interfaces /usr/local/app/guardian-interfaces-*.tgz /tmp/inte COPY --link common/package.json common/tsconfig*.json yarn.lock ./ COPY --link common/src src/ RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/interfaces']='file:/tmp/interfaces.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" -RUN --mount=type=cache,target=/root/.yarn \ +RUN --mount=type=cache,target=${YARN_CACHE_FOLDER} \ yarn install && yarn pack # Stage 3: Installing production dependecies @@ -29,7 +29,7 @@ COPY --link --from=interfaces /usr/local/app/guardian-interfaces-*.tgz /tmp/inte COPY --link --from=common /usr/local/app/guardian-common-*.tgz /tmp/common.tgz COPY --link auth-service/package.json auth-service/tsconfig*.json auth-service/Gulpfile.mjs yarn.lock ./ RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/interfaces']='file:/tmp/interfaces.tgz'; input.dependencies['@guardian/common']='file:/tmp/common.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" -RUN --mount=type=cache,target=/root/.yarn,sharing=private \ +RUN --mount=type=cache,target=${YARN_CACHE_FOLDER},sharing=private \ yarn install --prod # Stage 4: Build service @@ -39,8 +39,8 @@ COPY --link --from=common /usr/local/app/guardian-common-*.tgz /tmp/common.tgz COPY --link --from=deps /usr/local/app/package.json /usr/local/app/tsconfig*.json /usr/local/app/Gulpfile.mjs /usr/local/app/yarn.lock ./ COPY --link auth-service/environments environments/ COPY --link auth-service/src src/ -RUN --mount=type=cache,target=/root/.yarn \ - yarn install --frozen-lockfile && yarn run build:prod +RUN --mount=type=cache,target=${YARN_CACHE_FOLDER} \ + yarn install --immutable && yarn run build:prod # Stage 5: Create the final image FROM base as image diff --git a/auth-service/Dockerfile.demo b/auth-service/Dockerfile.demo index 7c1acbf224..e2425631bc 100644 --- a/auth-service/Dockerfile.demo +++ b/auth-service/Dockerfile.demo @@ -1,6 +1,6 @@ # syntax=docker/dockerfile:1 # Stage 0: Use node image for base image for all stages -ARG NODE_VERSION=20.11.1-alpine +ARG NODE_VERSION=20.16-alpine FROM node:${NODE_VERSION} as base WORKDIR /usr/local/app # Define an argument `YARN_CACHE_FOLDER` for the Yarn cache directory @@ -10,9 +10,9 @@ ARG YARN_CACHE_FOLDER=/root/.yarn FROM base as interfaces COPY --link interfaces/package.json interfaces/tsconfig*.json yarn.lock ./ COPY --link interfaces/src src/ -# Here and after. Leverage a cache mount to /root/.yarn to speed up subsequent builds -RUN --mount=type=cache,target=/root/.yarn \ - yarn install --frozen-lockfile && yarn pack +# Here and after. Leverage a cache mount to `YARN_CACHE_FOLDER` to speed up subsequent builds +RUN --mount=type=cache,target=${YARN_CACHE_FOLDER} \ + yarn install --immutable && yarn pack # Stage 2: Build common module FROM base as common @@ -20,7 +20,7 @@ COPY --link --from=interfaces /usr/local/app/guardian-interfaces-*.tgz /tmp/inte COPY --link common/package.json common/tsconfig*.json yarn.lock ./ COPY --link common/src src/ RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/interfaces']='file:/tmp/interfaces.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" -RUN --mount=type=cache,target=/root/.yarn \ +RUN --mount=type=cache,target=${YARN_CACHE_FOLDER} \ yarn install && yarn pack # Stage 3: Installing production dependecies @@ -29,7 +29,7 @@ COPY --link --from=interfaces /usr/local/app/guardian-interfaces-*.tgz /tmp/inte COPY --link --from=common /usr/local/app/guardian-common-*.tgz /tmp/common.tgz COPY --link auth-service/package.json auth-service/tsconfig*.json auth-service/Gulpfile.mjs yarn.lock ./ RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/interfaces']='file:/tmp/interfaces.tgz'; input.dependencies['@guardian/common']='file:/tmp/common.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" -RUN --mount=type=cache,target=/root/.yarn,sharing=private \ +RUN --mount=type=cache,target=${YARN_CACHE_FOLDER},sharing=private \ yarn install --prod # Stage 4: Build service @@ -39,8 +39,8 @@ COPY --link --from=common /usr/local/app/guardian-common-*.tgz /tmp/common.tgz COPY --link --from=deps /usr/local/app/package.json /usr/local/app/tsconfig*.json /usr/local/app/Gulpfile.mjs /usr/local/app/yarn.lock ./ COPY --link auth-service/environments environments/ COPY --link auth-service/src src/ -RUN --mount=type=cache,target=/root/.yarn \ - yarn install --frozen-lockfile && yarn run build:demo +RUN --mount=type=cache,target=${YARN_CACHE_FOLDER} \ + yarn install --immutable && yarn run build:demo # Stage 5: Create the final image FROM base as image diff --git a/auth-service/src/helpers/fixtures.ts b/auth-service/src/helpers/fixtures.ts index b9690d0c93..2578c4446d 100644 --- a/auth-service/src/helpers/fixtures.ts +++ b/auth-service/src/helpers/fixtures.ts @@ -2,6 +2,7 @@ import { User } from '../entity/user.js'; import { UserRole } from '@guardian/interfaces'; import { DatabaseServer } from '@guardian/common'; import { UserPassword } from '#utils'; +import process from 'process'; /** * Create default users @@ -18,7 +19,7 @@ export async function fixtures(): Promise { }] for (const user of users) { - const password = await UserPassword.generatePasswordV2('test'); + const password = await UserPassword.generatePasswordV2(process.env.SR_INITIAL_PASSWORD || 'test'); const row = usersRepository.create(User, { ...user, password: password.password, diff --git a/docker-compose.yml b/docker-compose.yml index 4b7e0ab212..519023c2c3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,10 +2,9 @@ # Environment leverage the gerarchy defined in the docker compose between "env_file" and "environment" attributes # ecosystem variables defined in the "env_file" .env.${GUARDIAN_ENV}.guardian.system # specific service variables defined by "environment" can override what is defined in the ecosystem file -version: "3.8" services: mongo: - image: mongo:6.0.13 + image: mongo:6.0.16 command: "--setParameter allowDiskUseByDefault=true" restart: always expose: @@ -24,6 +23,7 @@ services: cache: image: registry.redict.io/redict + platform: linux/amd64 restart: always expose: - 6379 @@ -39,7 +39,7 @@ services: # - seq_data:/data ipfs-node: - image: ipfs/kubo:v0.26.0 + image: ipfs/kubo:v0.29.0 ports: - "5001:5001" - "4001:4001" @@ -49,7 +49,7 @@ services: - ipfs_export:/export:rw message-broker: - image: nats:2.9.24 + image: nats:2.9.25 expose: - 4222 ports: @@ -85,7 +85,7 @@ services: environment: - GUARDIAN_ENV=${GUARDIAN_ENV} volumes: - - ./notification-service/configs:/usr/local/notification-service/configs:ro + - ./notification-service/configs:/usr/local/app/configs:ro logger-service: env_file: @@ -101,7 +101,7 @@ services: expose: - 6555 volumes: - - ./logger-service/configs:/usr/local/logger-service/configs:ro + - ./logger-service/configs:/usr/local/app/configs:ro queue-service: env_file: @@ -138,8 +138,8 @@ services: expose: - 6555 volumes: - - ./worker-service/tls:/usr/local/worker-service/tls:ro - - ./worker-service/configs:/usr/local/worker-service/configs:ro + - ./worker-service/tls:/usr/local/app/tls:ro + - ./worker-service/configs:/usr/local/app/configs:ro deploy: replicas: 2 @@ -153,8 +153,8 @@ services: ports: - '5005:5005' volumes: - - ./auth-service/tls:/usr/local/auth-service/tls:ro - - ./auth-service/configs:/usr/local/auth-service/configs:ro + - ./auth-service/tls:/usr/local/app/tls:ro + - ./auth-service/configs:/usr/local/app/configs:ro depends_on: - mongo - vault @@ -187,7 +187,7 @@ services: environment: - GUARDIAN_ENV=${GUARDIAN_ENV} volumes: - - ./api-gateway/configs:/usr/local/api-gateway/configs:ro + - ./api-gateway/configs:/usr/local/app/configs:ro ai-service: env_file: @@ -203,7 +203,8 @@ services: - message-broker - logger-service volumes: - - ./ai-service/data:/usr/local/ai-service/data:rw + - ./ai-service/faiss-vector:/usr/local/app/faiss-vector:rw + - ./ai-service/data:/usr/local/app/data:rw environment: - GUARDIAN_ENV=${GUARDIAN_ENV} - VECTOR_STORAGE_PATH=./faiss-vector @@ -229,8 +230,8 @@ services: - 50000-60000 - 5006 volumes: - - ./policy-service/tls:/usr/local/policy-service/tls:ro - - ./policy-service/configs:/usr/local/policy-service/configs:ro + - ./policy-service/tls:/usr/local/app/tls:ro + - ./policy-service/configs:/usr/local/app/configs:ro guardian-service: env_file: @@ -242,8 +243,8 @@ services: ports: - "5007:5007" volumes: - - ./guardian-service/tls:/usr/local/guardian-service/tls:ro - - ./guardian-service/configs:/usr/local/guardian-service/configs:ro + - ./guardian-service/tls:/usr/local/app/tls:ro + - ./guardian-service/configs:/usr/local/app/configs:ro depends_on: - mongo - message-broker diff --git a/docs/.gitbook/assets/image (680).png b/docs/.gitbook/assets/image (680).png new file mode 100644 index 0000000000..0883711a6c Binary files /dev/null and b/docs/.gitbook/assets/image (680).png differ diff --git a/docs/.gitbook/assets/image (681).png b/docs/.gitbook/assets/image (681).png new file mode 100644 index 0000000000..9768214143 Binary files /dev/null and b/docs/.gitbook/assets/image (681).png differ diff --git a/docs/.gitbook/assets/image (682).png b/docs/.gitbook/assets/image (682).png new file mode 100644 index 0000000000..6d5d60d5e9 Binary files /dev/null and b/docs/.gitbook/assets/image (682).png differ diff --git a/docs/.gitbook/assets/image (683).png b/docs/.gitbook/assets/image (683).png new file mode 100644 index 0000000000..53236da452 Binary files /dev/null and b/docs/.gitbook/assets/image (683).png differ diff --git a/docs/.gitbook/assets/image (684).png b/docs/.gitbook/assets/image (684).png new file mode 100644 index 0000000000..1ffe440456 Binary files /dev/null and b/docs/.gitbook/assets/image (684).png differ diff --git a/docs/.gitbook/assets/image (685).png b/docs/.gitbook/assets/image (685).png new file mode 100644 index 0000000000..633049cb23 Binary files /dev/null and b/docs/.gitbook/assets/image (685).png differ diff --git a/docs/SUMMARY.md b/docs/SUMMARY.md index bc1e109e91..472877a42f 100644 --- a/docs/SUMMARY.md +++ b/docs/SUMMARY.md @@ -199,6 +199,8 @@ * [messagesReportBlock](guardian/standard-registry/policies/policy-creation/introduction/messagesreportblock.md) * [notificationBlock](guardian/standard-registry/policies/policy-creation/introduction/notificationblock.md) * [Button Block Addon (buttonBlockAddon)](guardian/standard-registry/policies/policy-creation/introduction/button-block-addon-buttonblockaddon.md) + * [Dropdown Block Addon (dropdownBlockAddon)](guardian/standard-registry/policies/policy-creation/introduction/dropdown-block-addon-dropdownblockaddon.md) + * [Request Vc Document Block Addon (requestVcDocumentBlockAddon)](guardian/standard-registry/policies/policy-creation/introduction/request-vc-document-block-addon-requestvcdocumentblockaddon.md) * [💻 Creating Policy using UI](guardian/standard-registry/policies/policy-creation/policy-demo.md) * [💻 Creating a Policy through Policy Configurator](guardian/standard-registry/policies/policy-creation/creating-a-policy-through-policy-configurator/README.md) * [Getting Started with the Policy Workflows](guardian/standard-registry/policies/policy-creation/creating-a-policy-through-policy-configurator/getting-started-with-the-policy-workflows.md) diff --git a/docs/guardian/standard-registry/policies/policy-creation/introduction/README.md b/docs/guardian/standard-registry/policies/policy-creation/introduction/README.md index 7a2bafd1ca..6c9530be7c 100644 --- a/docs/guardian/standard-registry/policies/policy-creation/introduction/README.md +++ b/docs/guardian/standard-registry/policies/policy-creation/introduction/README.md @@ -4,49 +4,4 @@ Starting with the [Wikipedia definition](https://en.wikipedia.org/wiki/Workflow\ ### Available Policy Workflows Blocks -| Block | Definition | Documentation Link | -| :-----------------------------------------------: | :-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------------------------------: | -| InterfaceContainerBlock | A block which contains and organizes other blocks. | [InterfaceContainerBlock](container-workflow-block.md) | -| PolicyRolesBlock | A block which determines a role for the user. | [PolicyRolesBlock](roles-workflow-block.md) | -| InterfaceStepBlock | Similar to the InterfaceContainerBlock, with the difference that it can only render a single child element. | [InterfaceStepBlock](step-workflow-block.md) | -| requestVCDocumentBlock | A type of the block which creates a form from the schema, and sends the document to the server. | [requestVCDocumentBlock](request-workflow-block.md) | -| sendToGuardianBlock | A type of the block which can save a new or updated document. | [sendToGuardianBlock](send-workflow-block.md) | -| reassigningBlock | A type of block which re-signs the document and change the user to document owner. | [reassigningBlock](reassigningblock.md) | -| InformationBlock | A block type which can display a notification or a progress bar. | [InformationBlock](information-workflow-block.md) | -| InterfaceDocumentsSourceBlock | A block type which outputs information from the DB as grid. | [InterfaceDocumentsSourceBlock](interfacedocumentssourceblock.md) | -| paginationAddon | A block type which adds pagination to the InterfaceDocumentSourceBlock if added | [paginationAddon](paginationaddon.md) | -| DocumentsSourceAddOn | A type of block for searching VC as grid | [DocumentsSourceAddOn](documentssourceaddonblock.md) | -| filtersAddOn | A child block for 'DocumentsSourceAddon'. Contains additional dynamic filters | [filtersAddOn](filtersaddonblock.md) | -| InterfaceActionBlock | A block to create custom actions. | [InterfaceActionBlock](action-workflow-block.md) | -| externalDataBlock | Receives data from the external source and passes them over the the next block. | [externalDataBlock](external-data-workflow-block.md) | -| retirementDocumentBlock | Receives the VC from the previous block and retires based on the rule(s). | [retirementDocumentBlock](retirementdocumentblock.md) | -| wipeDocumentBlock | Makes a wipe of the token. Receives VC from the previous block. Passes a new VP to the next block. | [wipeDocumentBlock](token-wipe-workflow-block.md) | -| calculateContainerBlock & calculateMathAddonBlock |

The blocks to calculate. calculateContainerBlock: Receives VC from the previous block. Passes the new VC to the next block.
calculateMathOnBlock: Child block for 'calculateContainerBlock'. Contains descriptions of variables and formulas.

| [calculateContainerBlock & calculateMathAddonBlock](calculatecontainerblock-and-calculatemathaddonblock.md) | -| reportBlock | The block container for TrustChain. | [reportBlock & reportItemBlock](reportblock-and-reportitemblock.md) | -| reportItemBlock | The block for setting up the elements of the TrustChain. | [reportBlock & reportItemBlock](reportblock-and-reportitemblock.md) | -| Switch Block | This block transfers execution to one or more blocks depending on the parameters | [switchBlock](switchblock.md) | -| timerBlock | timer object which triggers the event | [TimerBlock](timerblock.md) | -| aggregateDocumentBlock | block responsible for aggregation of the documents | [aggregateDocumentBlock](aggregatedocumentblock.md) | -| revocationBlock | This Block finds related messages in policy topics, and revokes those messages and sends it to Hedera topic, but it doesn’t save documents in DB | [revocationBlock](https://github.com/hashgraph/guardian/blob/main/docs/available-policy-workflow-blocks/broken-reference/README.md) | -| setRelationshipsBlock | Contains DocumentSourceAddOn Block and set relationships for input document. | [setRelationshipBlock](setrelationshipsblock.md) | -| buttonBlock | Block responsible for creating buttons | [buttonBlock](buttonblock.md) | -| documentValidatorBlock | Block to validate documents, including linked documents | [documentValidatorBlock](documentvalidatorblock.md) | -| tokenActionBlock | Block is responsible to automation actions related to tokens | [tokenActionBlock](tokenactionblock.md) | -| tokenConfirmationBlock | Block enables the owner of the private key for the account to manually perform operations with the token | [tokenConfirmationBlock](tokenconfirmationblock.md) | -| mintDocumentBlock | Block is responsible for adding configurations on calculating the amount of tokens to be minted. | [mintDocumentBlock](mintdocumentblock.md) | -| groupManagerBlock | Block allows to manage group membership, add and remove users from the group. | [groupManagerBlock](groupmanagerblock.md) | -| multiSignBlock | This block provides a way to specify multiple signators for a single VC document, and then create a VP based on it. | [multiSignBlock](multisignblock.md) | -| customLogicBlock | This block is used to perform Logic | [customLogicBlock](customlogicblock.md) | -| splitBlock | This block allows to accumulate VC documents and produce new VCs in fixed chunks |

splitBlock

| -| wipeDocumentBlock | This block is used to wipe the Token | [wipeDocumentBlock](token-wipe-workflow-block.md) | -| CreateTokenBlock | This block is used to create Token template | [CreateTokenBlock](create-token-block.md) | -| impactAddon | This is an addon to create token impacts | [impactAddon](impactaddon.md) | -| Http Request Block | This block is used to retrieve outside data | [HttpRequestBlock](http-request-block.md) | -| historyAddon | This block turn on history on interfaceDocumentsSourceBlock. | [historyAddon](historyaddon.md) | -| selectiveAttributes Block | This block will filter attributes (option field) in documents returned by documentsSourceAddon. | [selectiveAttributesBlock](selectiveattributes-block.md) | -| tagsManagerBlock | This block is responsible for managing tags in policies. | [tagsManagerBlock](tagsmanagerblock.md) | -| externalTopicBlock | This block allows to configure the link to Hedera topics established by other policy instances for monitoring of ‘document published’ messages and ingestion of the targeted VC documents. | [externalTopicBlock](externaltopicblock.md) | -| messagesReportBlock | This block allows to create report based on the inter-referenced messages. | [messagesReportBlock](messagesreportblock.md) | -| notificationBlock | This block is used to generate notifications | [notificationBlock](notificationblock.md) | -| extractDataBlock | This block extractDataBlock provides means to extract a data set which corresponds to any of these embedded schemas (at any depth level) | [extractDataBlock](externaldatablock.md) | -| button block Addon | This block is used to display interactive buttons | [buttonBlockAddon](button-block-addon-buttonblockaddon.md) | +
BlockDefinitionDocumentation Link
InterfaceContainerBlockA block which contains and organizes other blocks.InterfaceContainerBlock
PolicyRolesBlockA block which determines a role for the user.PolicyRolesBlock
InterfaceStepBlockSimilar to the InterfaceContainerBlock, with the difference that it can only render a single child element.InterfaceStepBlock
requestVCDocumentBlockA type of the block which creates a form from the schema, and sends the document to the server.requestVCDocumentBlock
sendToGuardianBlockA type of the block which can save a new or updated document.sendToGuardianBlock
reassigningBlockA type of block which re-signs the document and change the user to document owner.reassigningBlock
InformationBlockA block type which can display a notification or a progress bar.InformationBlock
InterfaceDocumentsSourceBlockA block type which outputs information from the DB as grid.InterfaceDocumentsSourceBlock
paginationAddonA block type which adds pagination to the InterfaceDocumentSourceBlock if addedpaginationAddon
DocumentsSourceAddOnA type of block for searching VC as gridDocumentsSourceAddOn
filtersAddOnA child block for 'DocumentsSourceAddon'. Contains additional dynamic filtersfiltersAddOn
InterfaceActionBlockA block to create custom actions.InterfaceActionBlock
externalDataBlockReceives data from the external source and passes them over the the next block.externalDataBlock
retirementDocumentBlockReceives the VC from the previous block and retires based on the rule(s).retirementDocumentBlock
wipeDocumentBlockMakes a wipe of the token. Receives VC from the previous block. Passes a new VP to the next block.wipeDocumentBlock
calculateContainerBlock & calculateMathAddonBlockThe blocks to calculate. calculateContainerBlock: Receives VC from the previous block. Passes the new VC to the next block.
calculateMathOnBlock: Child block for 'calculateContainerBlock'. Contains descriptions of variables and formulas.
calculateContainerBlock & calculateMathAddonBlock
reportBlockThe block container for TrustChain.reportBlock & reportItemBlock
reportItemBlockThe block for setting up the elements of the TrustChain.reportBlock & reportItemBlock
Switch BlockThis block transfers execution to one or more blocks depending on the parametersswitchBlock
timerBlocktimer object which triggers the eventTimerBlock
aggregateDocumentBlockblock responsible for aggregation of the documentsaggregateDocumentBlock
revocationBlockThis Block finds related messages in policy topics, and revokes those messages and sends it to Hedera topic, but it doesn’t save documents in DBrevocationBlock
setRelationshipsBlockContains DocumentSourceAddOn Block and set relationships for input document.setRelationshipBlock
buttonBlockBlock responsible for creating buttonsbuttonBlock
documentValidatorBlockBlock to validate documents, including linked documentsdocumentValidatorBlock
tokenActionBlockBlock is responsible to automation actions related to tokenstokenActionBlock
tokenConfirmationBlockBlock enables the owner of the private key for the account to manually perform operations with the tokentokenConfirmationBlock
mintDocumentBlockBlock is responsible for adding configurations on calculating the amount of tokens to be minted.mintDocumentBlock
groupManagerBlockBlock allows to manage group membership, add and remove users from the group.groupManagerBlock
multiSignBlockThis block provides a way to specify multiple signators for a single VC document, and then create a VP based on it.multiSignBlock
customLogicBlockThis block is used to perform LogiccustomLogicBlock
splitBlockThis block allows to accumulate VC documents and produce new VCs in fixed chunkssplitBlock
wipeDocumentBlockThis block is used to wipe the TokenwipeDocumentBlock
CreateTokenBlockThis block is used to create Token templateCreateTokenBlock
impactAddonThis is an addon to create token impactsimpactAddon
Http Request BlockThis block is used to retrieve outside dataHttpRequestBlock
historyAddonThis block turn on history on interfaceDocumentsSourceBlock.historyAddon
selectiveAttributes BlockThis block will filter attributes (option field) in documents returned by documentsSourceAddon.selectiveAttributesBlock
tagsManagerBlockThis block is responsible for managing tags in policies.tagsManagerBlock
externalTopicBlockThis block allows to configure the link to Hedera topics established by other policy instances for monitoring of ‘document published’ messages and ingestion of the targeted VC documents.externalTopicBlock
messagesReportBlockThis block allows to create report based on the inter-referenced messages.messagesReportBlock
notificationBlockThis block is used to generate notificationsnotificationBlock
extractDataBlockThis block extractDataBlock provides means to extract a data set which corresponds to any of these embedded schemas (at any depth level)extractDataBlock
button block AddonThis block is used to display interactive buttonsbuttonBlockAddon
Dropdown Block AddonThe block is to display an interactive dropdown menudropdownBlockAddon
RequestVC Document Block AddonThis block is to display an interactive button in the interfaceDocumentsSourceBlock.requestVcDocumentBlockAddon
diff --git a/docs/guardian/standard-registry/policies/policy-creation/introduction/dropdown-block-addon-dropdownblockaddon.md b/docs/guardian/standard-registry/policies/policy-creation/introduction/dropdown-block-addon-dropdownblockaddon.md new file mode 100644 index 0000000000..0cfac06ad5 --- /dev/null +++ b/docs/guardian/standard-registry/policies/policy-creation/introduction/dropdown-block-addon-dropdownblockaddon.md @@ -0,0 +1,66 @@ +# Dropdown Block Addon (dropdownBlockAddon) + +The purpose of this block is to display an interactive dropdown menu in the interfaceDocumentsSourceBlock. + +## Usage + +As shown in the example below, dropdownBlockAddon blocks should be placed inside interfaceDocumentsSourceBlock blocks. Source addons, which return documents for the dropdown, should be placed inside dropdownBlockAddon. + +
+ +## Properties + +| Property Name | Description | Example | Status | +| ---------------------------- | ----------------------------------------------------------------------------- | ----------------------------------- | ------ | +| Option Name (_optionName_) | The label (name) which is shown in dropdown items. | document.credentialSubject.0.field0 | | +| Option Value (_optionValue_) | The value which will be used when a specific item is clicked. | document.credentialSubject.0.id | | +| Field (_field_) | The field in selected document which will be populated with the option value. | assignedTo | | + +
+ +## Events + +Dropdown block addon events will be automatically added to document source. + +
+ +## API + +The API for the dropdownBlockAddon has both GET and POST methods: + +1. Example response to the GET request: + +``` +{ + "id": "47169fdc-900f-4e07-abb4-5510d7be1175", + "blockType": "dropdownBlockAddon", + "optionName": "document.credentialSubject.0.field0", + "optionValue": "document.credentialSubject.0.id", + "field": "assignedTo", + "documents": [ + { + "name": "example", + "optionValue": "did:hedera:testnet:9XvzF671JeyoVRg8PvSZBTTyKyrvnZu2Mz7qE6FZXY8P_0.0.4481265", + "value": "66b28683d029375c10f0f4ef" + } + ], +} + +``` + +A response to the GET request includes all block settings and: + +● documents - Dropdown options + +2. Example payload for the POST request: + +``` +{ + "documentId": "66b28672d029375c10f0f4b6", + "dropdownDocumentId": "66b28683d029375c10f0f4ef" +} +``` + +● documentId - Selected document + +● dropdownDocumentId - Dropdown item which was clicked diff --git a/docs/guardian/standard-registry/policies/policy-creation/introduction/request-vc-document-block-addon-requestvcdocumentblockaddon.md b/docs/guardian/standard-registry/policies/policy-creation/introduction/request-vc-document-block-addon-requestvcdocumentblockaddon.md new file mode 100644 index 0000000000..aa7b0c99df --- /dev/null +++ b/docs/guardian/standard-registry/policies/policy-creation/introduction/request-vc-document-block-addon-requestvcdocumentblockaddon.md @@ -0,0 +1,84 @@ +# Request Vc Document Block Addon (requestVcDocumentBlockAddon) + +The purpose of this block is to display an interactive button in the interfaceDocumentsSourceBlock. + +## Usage + +As shown in the example below, requestVcDocumentBlockAddon blocks should be placed inside interfaceDocumentsSourceBlock blocks. + +
+ +## Properties + +| Property Name | Description | Example | Status | +| ------------------------------ | -------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | +| Button Name (_buttonName_) | The label (name) of the button as displayed to the user. | Add report | | +| UI Class (_uiClass_) | The UI class of the button. | "btn-approve”, “btn-reject”, “btn-link | | +| Dialog Title (_dialogTitle_) | The title of the dialog. | Add report | | +| Schema (_schema_) | Schema which will be used for document creation. | #de62118a-d746-4c9f-ba1a-2278b13a2137 | | +| Id Type (_idTypev)_ | Type of identifier in document which will be created. | “UUID”, “DID”, “OWNER” | | +| Preset (_preset_) | Will selected document be used as preset. | true, false | | +| Preset Schema (_presetSchema_) | Schema which will be used as a preset schema. | #de62118a-d746-4c9f-ba1a-2278b13a2137 | | +| Preset Fields (_presetFields_) | Preset fields configuration. |

[

{

"name": "field0",

"title": "Project Details",

"value": "field0",

"readonly": false

}

]

| | + +
+ +## Events + +Request VC document block addon events will be automatically added to document source. + +
+ +## API + +The API for the dropdownBlockAddon has both GET and POST methods: + +1\. Example response to the GET request: + +``` +{ + "id": "20639b5d-c43d-4aa0-a1d1-d0ac36e867de", + "blockType": "requestVcDocumentBlockAddon", + "buttonName": "Add Report", + "uiClass": "link", + "dialogTitle": "Add Report", + "presetFields": [ + { + "name": "field0", + "title": "Project Details", + "value": "field0", + "readonly": false + }, + ... + ], + "schema": { + ... + }, + "idType": "UUID", + "preset": true, + "presetSchema": "#de62118a-d746-4c9f-ba1a-2278b13a2137", +} + +``` + +A response to the GET request includes all block settings and: + +● schema - Schema document + +2. Example payload for the POST request: + +``` + + "document": { + "field0": "Device", + "field1": "Organization", + ... + }, + "ref": "66ba0cad0edaef237a78b44b" +} + +``` + +● document - Credential subject + +● ref - Reference document identifier diff --git a/guardian-service/Dockerfile b/guardian-service/Dockerfile index 8188f79ea3..3cc13e59a1 100644 --- a/guardian-service/Dockerfile +++ b/guardian-service/Dockerfile @@ -1,6 +1,6 @@ # syntax=docker/dockerfile:1 # Stage 0: Use node image for base image for all stages -ARG NODE_VERSION=20.11.1-alpine +ARG NODE_VERSION=20.16-alpine FROM node:${NODE_VERSION} as base WORKDIR /usr/local/app # Define an argument `YARN_CACHE_FOLDER` for the Yarn cache directory @@ -10,9 +10,9 @@ ARG YARN_CACHE_FOLDER=/root/.yarn FROM base as interfaces COPY --link interfaces/package.json interfaces/tsconfig*.json yarn.lock ./ COPY --link interfaces/src src/ -# Here and after. Leverage a cache mount to /root/.yarn to speed up subsequent builds -RUN --mount=type=cache,target=/root/.yarn \ - yarn install --frozen-lockfile && yarn pack +# Here and after. Leverage a cache mount to `YARN_CACHE_FOLDER` to speed up subsequent builds +RUN --mount=type=cache,target=${YARN_CACHE_FOLDER} \ + yarn install --immutable && yarn pack # Stage 2: Build common module FROM base as common @@ -20,7 +20,7 @@ COPY --link --from=interfaces /usr/local/app/guardian-interfaces-*.tgz /tmp/inte COPY --link common/package.json common/tsconfig*.json yarn.lock ./ COPY --link common/src src/ RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/interfaces']='file:/tmp/interfaces.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" -RUN --mount=type=cache,target=/root/.yarn \ +RUN --mount=type=cache,target=${YARN_CACHE_FOLDER} \ yarn install && yarn pack # Stage 3: Installing production dependecies @@ -29,7 +29,7 @@ COPY --link --from=interfaces /usr/local/app/guardian-interfaces-*.tgz /tmp/inte COPY --link --from=common /usr/local/app/guardian-common-*.tgz /tmp/common.tgz COPY --link guardian-service/package.json guardian-service/tsconfig*.json yarn.lock ./ RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/interfaces']='file:/tmp/interfaces.tgz'; input.dependencies['@guardian/common']='file:/tmp/common.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" -RUN --mount=type=cache,target=/root/.yarn,sharing=private \ +RUN --mount=type=cache,target=${YARN_CACHE_FOLDER},sharing=private \ yarn install --prod # Stage 4: Build service @@ -38,8 +38,8 @@ COPY --link --from=interfaces /usr/local/app/guardian-interfaces-*.tgz /tmp/inte COPY --link --from=common /usr/local/app/guardian-common-*.tgz /tmp/common.tgz COPY --link --from=deps /usr/local/app/package.json /usr/local/app/tsconfig*.json /usr/local/app/yarn.lock ./ COPY --link guardian-service/src src/ -RUN --mount=type=cache,target=/root/.yarn \ - yarn install --frozen-lockfile && yarn run build:prod +RUN --mount=type=cache,target=${YARN_CACHE_FOLDER} \ + yarn install --immutable && yarn run build:prod # Stage 5: Create the final image FROM base as image diff --git a/guardian-service/configs/.env.guardian b/guardian-service/configs/.env.guardian index acd56dcfcf..7a97753a45 100644 --- a/guardian-service/configs/.env.guardian +++ b/guardian-service/configs/.env.guardian @@ -10,8 +10,6 @@ GET_SENTINEL_API_KEY=... # Ecosystem Defined Variables HEDERA_NET="testnet" PREUSED_HEDERA_NET="testnet" -JWT_PRIVATE_KEY="..." -JWT_PUBLIC_KEY="..." MQ_ADDRESS="localhost" DB_HOST="localhost" INITIAL_BALANCE="100" @@ -75,4 +73,4 @@ SEQ_API_KEY="" #MONGO_INIT MIN_POOL_SIZE="1" MAX_POOL_SIZE="5" -MAX_IDLE_TIME_MS="30000" \ No newline at end of file +MAX_IDLE_TIME_MS="30000" diff --git a/guardian-service/configs/.env.guardian.develop b/guardian-service/configs/.env.guardian.develop index 57f6aab4ec..b4d130c2cd 100644 --- a/guardian-service/configs/.env.guardian.develop +++ b/guardian-service/configs/.env.guardian.develop @@ -9,8 +9,6 @@ VAULT_APPROLE_SECRET_ID= # Ecosystem Defined Variables HEDERA_NET="testnet" PREUSED_HEDERA_NET="testnet" -JWT_PRIVATE_KEY="..." -JWT_PUBLIC_KEY="..." MQ_ADDRESS="localhost" DB_HOST="localhost" INITIAL_BALANCE="100" @@ -74,4 +72,4 @@ SEQ_API_KEY="" #MONGO_INIT MIN_POOL_SIZE="1" MAX_POOL_SIZE="5" -MAX_IDLE_TIME_MS="30000" \ No newline at end of file +MAX_IDLE_TIME_MS="30000" diff --git a/guardian-service/configs/.env.guardian.template b/guardian-service/configs/.env.guardian.template index 76c0340140..9ef9f1f616 100644 --- a/guardian-service/configs/.env.guardian.template +++ b/guardian-service/configs/.env.guardian.template @@ -9,8 +9,6 @@ VAULT_APPROLE_SECRET_ID= # Ecosystem Defined Variables HEDERA_NET="" PREUSED_HEDERA_NET="" -JWT_PRIVATE_KEY="..." -JWT_PUBLIC_KEY="..." MQ_ADDRESS="" DB_HOST="" INITIAL_BALANCE="100" diff --git a/indexer-api-gateway/Dockerfile b/indexer-api-gateway/Dockerfile index f9f609d814..6de2ac6d0d 100644 --- a/indexer-api-gateway/Dockerfile +++ b/indexer-api-gateway/Dockerfile @@ -10,8 +10,8 @@ ARG YARN_CACHE_FOLDER=/root/.yarn FROM base as interfaces COPY --link indexer-interfaces/package.json indexer-interfaces/tsconfig*.json yarn.lock ./ COPY --link indexer-interfaces/src src/ -# Here and after. Leverage a cache mount to /root/.yarn to speed up subsequent builds -RUN --mount=type=cache,target=/root/.yarn \ +# Here and after. Leverage a cache mount to `YARN_CACHE_FOLDER` to speed up subsequent builds +RUN --mount=type=cache,target=${YARN_CACHE_FOLDER} \ yarn install --immutable && yarn pack # Stage 2: Build common module @@ -20,8 +20,8 @@ COPY --link --from=interfaces /usr/local/app/indexer-interfaces-*.tgz /tmp/index COPY --link indexer-common/package.json indexer-common/tsconfig*.json yarn.lock ./ COPY --link indexer-common/src src/ RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@indexer/interfaces']='file:/tmp/indexer-interfaces.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" -RUN --mount=type=cache,target=/root/.yarn \ - yarn install --immutable && yarn pack +RUN --mount=type=cache,target=${YARN_CACHE_FOLDER} \ + yarn install && yarn pack # Stage 3: Installing production dependecies FROM base as deps @@ -29,8 +29,8 @@ COPY --link --from=interfaces /usr/local/app/indexer-interfaces-*.tgz /tmp/index COPY --link --from=common /usr/local/app/indexer-common-*.tgz /tmp/indexer-common.tgz COPY --link indexer-api-gateway/package.json indexer-api-gateway/tsconfig*.json indexer-api-gateway/Gulpfile.mjs yarn.lock ./ RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@indexer/interfaces']='file:/tmp/indexer-interfaces.tgz'; input.dependencies['@indexer/common']='file:/tmp/indexer-common.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" -RUN --mount=type=cache,target=/root/.yarn,sharing=private \ - yarn install --immutable --prod +RUN --mount=type=cache,target=${YARN_CACHE_FOLDER},sharing=private \ + yarn install --prod # Stage 4: Build service FROM base as build @@ -39,7 +39,7 @@ COPY --link --from=common /usr/local/app/indexer-common-*.tgz /tmp/indexer-commo COPY --link --from=deps /usr/local/app/package.json /usr/local/app/tsconfig*.json /usr/local/app/Gulpfile.mjs /usr/local/app/yarn.lock ./ COPY --link indexer-api-gateway/environments environments/ COPY --link indexer-api-gateway/src src/ -RUN --mount=type=cache,target=/root/.yarn \ +RUN --mount=type=cache,target=${YARN_CACHE_FOLDER} \ yarn install --immutable && yarn run build:prod # Stage 5: Create the final image diff --git a/indexer-service/Dockerfile b/indexer-service/Dockerfile index d71076ebbb..649a14287b 100644 --- a/indexer-service/Dockerfile +++ b/indexer-service/Dockerfile @@ -10,8 +10,8 @@ ARG YARN_CACHE_FOLDER=/root/.yarn FROM base as interfaces COPY --link indexer-interfaces/package.json indexer-interfaces/tsconfig*.json yarn.lock ./ COPY --link indexer-interfaces/src src/ -# Here and after. Leverage a cache mount to /root/.yarn to speed up subsequent builds -RUN --mount=type=cache,target=/root/.yarn \ +# Here and after. Leverage a cache mount to `YARN_CACHE_FOLDER` to speed up subsequent builds +RUN --mount=type=cache,target=${YARN_CACHE_FOLDER} \ yarn install --immutable && yarn pack # Stage 2: Build common module @@ -20,8 +20,8 @@ COPY --link --from=interfaces /usr/local/app/indexer-interfaces-*.tgz /tmp/index COPY --link indexer-common/package.json indexer-common/tsconfig*.json yarn.lock ./ COPY --link indexer-common/src src/ RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@indexer/interfaces']='file:/tmp/indexer-interfaces.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" -RUN --mount=type=cache,target=/root/.yarn \ - yarn install --immutable && yarn pack +RUN --mount=type=cache,target=${YARN_CACHE_FOLDER} \ + yarn install && yarn pack # Stage 3: Installing production dependecies FROM base as deps @@ -29,8 +29,8 @@ COPY --link --from=interfaces /usr/local/app/indexer-interfaces-*.tgz /tmp/index COPY --link --from=common /usr/local/app/indexer-common-*.tgz /tmp/indexer-common.tgz COPY --link indexer-service/package.json indexer-service/tsconfig*.json yarn.lock ./ RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@indexer/interfaces']='file:/tmp/indexer-interfaces.tgz'; input.dependencies['@indexer/common']='file:/tmp/indexer-common.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" -RUN --mount=type=cache,target=/root/.yarn,sharing=private \ - yarn install --immutable --prod +RUN --mount=type=cache,target=${YARN_CACHE_FOLDER},sharing=private \ + yarn install --prod # Stage 4: Build service FROM base as build @@ -38,7 +38,7 @@ COPY --link --from=interfaces /usr/local/app/guardian-interfaces-*.tgz /tmp/inte COPY --link --from=common /usr/local/app/guardian-common-*.tgz /tmp/common.tgz COPY --link --from=deps /usr/local/app/package.json /usr/local/app/tsconfig*.json /usr/local/app/yarn.lock ./ COPY --link indexer-service/src src/ -RUN --mount=type=cache,target=/root/.yarn \ +RUN --mount=type=cache,target=${YARN_CACHE_FOLDER} \ yarn install --immutable && yarn run build:prod # Stage 5: Create the final image diff --git a/indexer-web-proxy/Dockerfile b/indexer-web-proxy/Dockerfile index 56ff7b815c..b5dc174bb2 100644 --- a/indexer-web-proxy/Dockerfile +++ b/indexer-web-proxy/Dockerfile @@ -10,8 +10,8 @@ ARG YARN_CACHE_FOLDER=/root/.yarn FROM base as interfaces COPY --link indexer-interfaces/package.json indexer-interfaces/tsconfig*.json yarn.lock ./ COPY --link indexer-interfaces/src src/ -# Leverage a cache mount to /root/.yarn to speed up subsequent builds -RUN --mount=type=cache,target=/root/.yarn \ +# Leverage a cache mount to `YARN_CACHE_FOLDER` to speed up subsequent builds +RUN --mount=type=cache,target=${YARN_CACHE_FOLDER} \ yarn install --immutable && yarn pack # Stage 2: Build frontend diff --git a/indexer-worker-service/Dockerfile b/indexer-worker-service/Dockerfile index d7f71df8c2..23bd20ee75 100644 --- a/indexer-worker-service/Dockerfile +++ b/indexer-worker-service/Dockerfile @@ -10,8 +10,8 @@ ARG YARN_CACHE_FOLDER=/root/.yarn FROM base as interfaces COPY --link indexer-interfaces/package.json indexer-interfaces/tsconfig*.json yarn.lock ./ COPY --link indexer-interfaces/src src/ -# Here and after. Leverage a cache mount to /root/.yarn to speed up subsequent builds -RUN --mount=type=cache,target=/root/.yarn \ +# Here and after. Leverage a cache mount to `YARN_CACHE_FOLDER` to speed up subsequent builds +RUN --mount=type=cache,target=${YARN_CACHE_FOLDER} \ yarn install --immutable && yarn pack # Stage 2: Build common module @@ -20,8 +20,8 @@ COPY --link --from=interfaces /usr/local/app/indexer-interfaces-*.tgz /tmp/index COPY --link indexer-common/package.json indexer-common/tsconfig*.json yarn.lock ./ COPY --link indexer-common/src src/ RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@indexer/interfaces']='file:/tmp/indexer-interfaces.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" -RUN --mount=type=cache,target=/root/.yarn \ - yarn install --immutable && yarn pack +RUN --mount=type=cache,target=${YARN_CACHE_FOLDER} \ + yarn install && yarn pack # Stage 3: Installing production dependecies FROM base as deps @@ -29,8 +29,8 @@ COPY --link --from=interfaces /usr/local/app/indexer-interfaces-*.tgz /tmp/index COPY --link --from=common /usr/local/app/indexer-common-*.tgz /tmp/indexer-common.tgz COPY --link indexer-worker-service/package.json indexer-worker-service/tsconfig*.json yarn.lock ./ RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@indexer/interfaces']='file:/tmp/indexer-interfaces.tgz'; input.dependencies['@indexer/common']='file:/tmp/indexer-common.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" -RUN --mount=type=cache,target=/root/.yarn,sharing=private \ - yarn install --immutable --prod +RUN --mount=type=cache,target=${YARN_CACHE_FOLDER},sharing=private \ + yarn install --prod # Stage 4: Build service FROM base as build @@ -38,7 +38,7 @@ COPY --link --from=interfaces /usr/local/app/indexer-interfaces-*.tgz /tmp/index COPY --link --from=common /usr/local/app/indexer-common-*.tgz /tmp/indexer-common.tgz COPY --link --from=deps /usr/local/app/package.json /usr/local/app/tsconfig*.json /usr/local/app/yarn.lock ./ COPY --link indexer-worker-service/src src/ -RUN --mount=type=cache,target=/root/.yarn \ +RUN --mount=type=cache,target=${YARN_CACHE_FOLDER} \ yarn install --immutable && yarn run build:prod # Stage 5: Create the final image diff --git a/logger-service/Dockerfile b/logger-service/Dockerfile index b2ef0eabbe..da94853632 100644 --- a/logger-service/Dockerfile +++ b/logger-service/Dockerfile @@ -1,6 +1,6 @@ # syntax=docker/dockerfile:1 # Stage 0: Use node image for base image for all stages -ARG NODE_VERSION=20.11.1-alpine +ARG NODE_VERSION=20.16-alpine FROM node:${NODE_VERSION} as base WORKDIR /usr/local/app # Define an argument `YARN_CACHE_FOLDER` for the Yarn cache directory @@ -10,9 +10,9 @@ ARG YARN_CACHE_FOLDER=/root/.yarn FROM base as interfaces COPY --link interfaces/package.json interfaces/tsconfig*.json yarn.lock ./ COPY --link interfaces/src src/ -# Here and after. Leverage a cache mount to /root/.yarn to speed up subsequent builds -RUN --mount=type=cache,target=/root/.yarn \ - yarn install --frozen-lockfile && yarn pack +# Here and after. Leverage a cache mount to `YARN_CACHE_FOLDER` to speed up subsequent builds +RUN --mount=type=cache,target=${YARN_CACHE_FOLDER} \ + yarn install --immutable && yarn pack # Stage 2: Build common module FROM base as common @@ -20,7 +20,7 @@ COPY --link --from=interfaces /usr/local/app/guardian-interfaces-*.tgz /tmp/inte COPY --link common/package.json common/tsconfig*.json yarn.lock ./ COPY --link common/src src/ RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/interfaces']='file:/tmp/interfaces.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" -RUN --mount=type=cache,target=/root/.yarn \ +RUN --mount=type=cache,target=${YARN_CACHE_FOLDER} \ yarn install && yarn pack # Stage 3: Installing production dependecies @@ -29,7 +29,7 @@ COPY --link --from=interfaces /usr/local/app/guardian-interfaces-*.tgz /tmp/inte COPY --link --from=common /usr/local/app/guardian-common-*.tgz /tmp/common.tgz COPY --link logger-service/package.json logger-service/tsconfig*.json yarn.lock ./ RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/interfaces']='file:/tmp/interfaces.tgz'; input.dependencies['@guardian/common']='file:/tmp/common.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" -RUN --mount=type=cache,target=/root/.yarn,sharing=private \ +RUN --mount=type=cache,target=${YARN_CACHE_FOLDER},sharing=private \ yarn install --prod # Stage 4: Build service @@ -38,8 +38,8 @@ COPY --link --from=interfaces /usr/local/app/guardian-interfaces-*.tgz /tmp/inte COPY --link --from=common /usr/local/app/guardian-common-*.tgz /tmp/common.tgz COPY --link --from=deps /usr/local/app/package.json /usr/local/app/tsconfig*.json /usr/local/app/yarn.lock ./ COPY --link logger-service/src src/ -RUN --mount=type=cache,target=/root/.yarn \ - yarn install --frozen-lockfile && yarn run build:prod +RUN --mount=type=cache,target=${YARN_CACHE_FOLDER} \ + yarn install --immutable && yarn run build:prod # Stage 5: Create the final image FROM base as image diff --git a/logger-service/configs/.env.logger b/logger-service/configs/.env.logger index d3eaea8af8..becdbc10aa 100644 --- a/logger-service/configs/.env.logger +++ b/logger-service/configs/.env.logger @@ -5,7 +5,6 @@ DB_DATABASE="logger_db" # Ecosystem Defined Variables HEDERA_NET="testnet" PREUSED_HEDERA_NET="testnet" -JWT_PRIVATE_KEY="..." MQ_ADDRESS="localhost" DB_HOST="localhost" MQ_MAX_PAYLOAD="1048576" diff --git a/logger-service/configs/.env.logger.develop b/logger-service/configs/.env.logger.develop index d3eaea8af8..becdbc10aa 100644 --- a/logger-service/configs/.env.logger.develop +++ b/logger-service/configs/.env.logger.develop @@ -5,7 +5,6 @@ DB_DATABASE="logger_db" # Ecosystem Defined Variables HEDERA_NET="testnet" PREUSED_HEDERA_NET="testnet" -JWT_PRIVATE_KEY="..." MQ_ADDRESS="localhost" DB_HOST="localhost" MQ_MAX_PAYLOAD="1048576" diff --git a/logger-service/configs/.env.logger.template b/logger-service/configs/.env.logger.template index 62732325d0..8ee8312a29 100644 --- a/logger-service/configs/.env.logger.template +++ b/logger-service/configs/.env.logger.template @@ -5,7 +5,6 @@ DB_DATABASE="logger_db" # Ecosystem Defined Variables HEDERA_NET="" PREUSED_HEDERA_NET="" -JWT_PRIVATE_KEY="..." MQ_ADDRESS="" DB_HOST="" MQ_MAX_PAYLOAD="" diff --git a/mrv-sender/Dockerfile b/mrv-sender/Dockerfile index 7d705a1975..8dcfa493a5 100644 --- a/mrv-sender/Dockerfile +++ b/mrv-sender/Dockerfile @@ -1,6 +1,6 @@ # syntax=docker/dockerfile:1 # Stage 0: Use node image for base image for all stages -ARG NODE_VERSION=20.11.1-alpine +ARG NODE_VERSION=20.16-alpine FROM node:${NODE_VERSION} as base WORKDIR /usr/local/app # Define an argument `YARN_CACHE_FOLDER` for the Yarn cache directory @@ -10,9 +10,9 @@ ARG YARN_CACHE_FOLDER=/root/.yarn FROM base as interfaces COPY --link interfaces/package.json interfaces/tsconfig*.json yarn.lock ./ COPY --link interfaces/src src/ -# Here and after. Leverage a cache mount to /root/.yarn to speed up subsequent builds -RUN --mount=type=cache,target=/root/.yarn \ - yarn install --frozen-lockfile && yarn pack +# Here and after. Leverage a cache mount to `YARN_CACHE_FOLDER` to speed up subsequent builds +RUN --mount=type=cache,target=${YARN_CACHE_FOLDER} \ + yarn install --immutable && yarn pack # Stage 2: Build common module FROM base as common @@ -20,7 +20,7 @@ COPY --link --from=interfaces /usr/local/app/guardian-interfaces-*.tgz /tmp/inte COPY --link common/package.json common/tsconfig*.json yarn.lock ./ COPY --link common/src src/ RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/interfaces']='file:/tmp/interfaces.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" -RUN --mount=type=cache,target=/root/.yarn \ +RUN --mount=type=cache,target=${YARN_CACHE_FOLDER} \ yarn install && yarn pack # Stage 3: Installing production dependecies @@ -29,7 +29,7 @@ COPY --link --from=interfaces /usr/local/app/guardian-interfaces-*.tgz /tmp/inte COPY --link --from=common /usr/local/app/guardian-common-*.tgz /tmp/common.tgz COPY --link mrv-sender/package.json mrv-sender/tsconfig*.json yarn.lock ./ RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/interfaces']='file:/tmp/interfaces.tgz'; input.dependencies['@guardian/common']='file:/tmp/common.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" -RUN --mount=type=cache,target=/root/.yarn,sharing=private \ +RUN --mount=type=cache,target=${YARN_CACHE_FOLDER},sharing=private \ yarn install --prod # Stage 4: Build service @@ -38,8 +38,8 @@ COPY --link --from=interfaces /usr/local/app/guardian-interfaces-*.tgz /tmp/inte COPY --link --from=common /usr/local/app/guardian-common-*.tgz /tmp/common.tgz COPY --link --from=deps /usr/local/app/package.json /usr/local/app/tsconfig*.json /usr/local/app/yarn.lock ./ COPY --link mrv-sender/src src/ -RUN --mount=type=cache,target=/root/.yarn \ - yarn install --frozen-lockfile && yarn run build:prod +RUN --mount=type=cache,target=${YARN_CACHE_FOLDER} \ + yarn install --immutable && yarn run build:prod # Stage 5: Create the final image FROM base as image diff --git a/notification-service/Dockerfile b/notification-service/Dockerfile index 8db3708ca1..40bc95d67c 100644 --- a/notification-service/Dockerfile +++ b/notification-service/Dockerfile @@ -1,6 +1,6 @@ # syntax=docker/dockerfile:1 # Stage 0: Use node image for base image for all stages -ARG NODE_VERSION=20.11.1-alpine +ARG NODE_VERSION=20.16-alpine FROM node:${NODE_VERSION} as base WORKDIR /usr/local/app # Define an argument `YARN_CACHE_FOLDER` for the Yarn cache directory @@ -10,9 +10,9 @@ ARG YARN_CACHE_FOLDER=/root/.yarn FROM base as interfaces COPY --link interfaces/package.json interfaces/tsconfig*.json yarn.lock ./ COPY --link interfaces/src src/ -# Here and after. Leverage a cache mount to /root/.yarn to speed up subsequent builds -RUN --mount=type=cache,target=/root/.yarn \ - yarn install --frozen-lockfile && yarn pack +# Here and after. Leverage a cache mount to `YARN_CACHE_FOLDER` to speed up subsequent builds +RUN --mount=type=cache,target=${YARN_CACHE_FOLDER} \ + yarn install --immutable && yarn pack # Stage 2: Build common module FROM base as common @@ -20,7 +20,7 @@ COPY --link --from=interfaces /usr/local/app/guardian-interfaces-*.tgz /tmp/inte COPY --link common/package.json common/tsconfig*.json yarn.lock ./ COPY --link common/src src/ RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/interfaces']='file:/tmp/interfaces.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" -RUN --mount=type=cache,target=/root/.yarn \ +RUN --mount=type=cache,target=${YARN_CACHE_FOLDER} \ yarn install && yarn pack # Stage 3: Installing production dependecies @@ -29,7 +29,7 @@ COPY --link --from=interfaces /usr/local/app/guardian-interfaces-*.tgz /tmp/inte COPY --link --from=common /usr/local/app/guardian-common-*.tgz /tmp/common.tgz COPY --link notification-service/package.json notification-service/tsconfig*.json yarn.lock ./ RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/interfaces']='file:/tmp/interfaces.tgz'; input.dependencies['@guardian/common']='file:/tmp/common.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" -RUN --mount=type=cache,target=/root/.yarn,sharing=private \ +RUN --mount=type=cache,target=${YARN_CACHE_FOLDER},sharing=private \ yarn install --prod # Stage 4: Build service @@ -38,8 +38,8 @@ COPY --link --from=interfaces /usr/local/app/guardian-interfaces-*.tgz /tmp/inte COPY --link --from=common /usr/local/app/guardian-common-*.tgz /tmp/common.tgz COPY --link --from=deps /usr/local/app/package.json /usr/local/app/tsconfig*.json /usr/local/app/yarn.lock ./ COPY --link notification-service/src src/ -RUN --mount=type=cache,target=/root/.yarn \ - yarn install --frozen-lockfile && yarn run build:prod +RUN --mount=type=cache,target=${YARN_CACHE_FOLDER} \ + yarn install --immutable && yarn run build:prod # Stage 5: Create the final image FROM base as image diff --git a/policy-service/Dockerfile b/policy-service/Dockerfile index 508e30605c..f021ca4f38 100644 --- a/policy-service/Dockerfile +++ b/policy-service/Dockerfile @@ -1,6 +1,6 @@ # syntax=docker/dockerfile:1 # Stage 0: Use node image for base image for all stages -ARG NODE_VERSION=20.11.1-alpine +ARG NODE_VERSION=20.16-alpine FROM node:${NODE_VERSION} as base WORKDIR /usr/local/app # Define an argument `YARN_CACHE_FOLDER` for the Yarn cache directory @@ -10,9 +10,9 @@ ARG YARN_CACHE_FOLDER=/root/.yarn FROM base as interfaces COPY --link interfaces/package.json interfaces/tsconfig*.json yarn.lock ./ COPY --link interfaces/src src/ -# Here and after. Leverage a cache mount to /root/.yarn to speed up subsequent builds -RUN --mount=type=cache,target=/root/.yarn \ - yarn install --frozen-lockfile && yarn pack +# Here and after. Leverage a cache mount to `YARN_CACHE_FOLDER` to speed up subsequent builds +RUN --mount=type=cache,target=${YARN_CACHE_FOLDER} \ + yarn install --immutable && yarn pack # Stage 2: Build common module FROM base as common @@ -20,7 +20,7 @@ COPY --link --from=interfaces /usr/local/app/guardian-interfaces-*.tgz /tmp/inte COPY --link common/package.json common/tsconfig*.json yarn.lock ./ COPY --link common/src src/ RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/interfaces']='file:/tmp/interfaces.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" -RUN --mount=type=cache,target=/root/.yarn \ +RUN --mount=type=cache,target=${YARN_CACHE_FOLDER} \ yarn install && yarn pack # Stage 3: Installing production dependecies @@ -29,7 +29,7 @@ COPY --link --from=interfaces /usr/local/app/guardian-interfaces-*.tgz /tmp/inte COPY --link --from=common /usr/local/app/guardian-common-*.tgz /tmp/common.tgz COPY --link policy-service/package.json policy-service/tsconfig*.json yarn.lock ./ RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/interfaces']='file:/tmp/interfaces.tgz'; input.dependencies['@guardian/common']='file:/tmp/common.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" -RUN --mount=type=cache,target=/root/.yarn,sharing=private \ +RUN --mount=type=cache,target=${YARN_CACHE_FOLDER},sharing=private \ yarn install --prod # Stage 4: Build service @@ -38,8 +38,8 @@ COPY --link --from=interfaces /usr/local/app/guardian-interfaces-*.tgz /tmp/inte COPY --link --from=common /usr/local/app/guardian-common-*.tgz /tmp/common.tgz COPY --link --from=deps /usr/local/app/package.json /usr/local/app/tsconfig*.json /usr/local/app/yarn.lock ./ COPY --link policy-service/src src/ -RUN --mount=type=cache,target=/root/.yarn \ - yarn install --frozen-lockfile && yarn run build:prod +RUN --mount=type=cache,target=${YARN_CACHE_FOLDER} \ + yarn install --immutable && yarn run build:prod # Stage 5: Create the final image FROM base as image diff --git a/policy-service/configs/.env.policy b/policy-service/configs/.env.policy index 83deef540e..9165b34f21 100644 --- a/policy-service/configs/.env.policy +++ b/policy-service/configs/.env.policy @@ -9,7 +9,6 @@ VAULT_APPROLE_SECRET_ID= # Ecosystem Defined Variables HEDERA_NET="testnet" PREUSED_HEDERA_NET="testnet" -JWT_PRIVATE_KEY="..." MQ_ADDRESS="localhost" DB_HOST="localhost" MESSAGE_LANG="en-US" @@ -60,4 +59,4 @@ SEQ_API_KEY="" #MONGO_INIT MIN_POOL_SIZE="1" MAX_POOL_SIZE="5" -MAX_IDLE_TIME_MS="30000" \ No newline at end of file +MAX_IDLE_TIME_MS="30000" diff --git a/policy-service/configs/.env.policy.develop b/policy-service/configs/.env.policy.develop index 61fc95bacc..d74ffb1dfc 100644 --- a/policy-service/configs/.env.policy.develop +++ b/policy-service/configs/.env.policy.develop @@ -9,7 +9,6 @@ VAULT_APPROLE_SECRET_ID= # Ecosystem Defined Variables HEDERA_NET="testnet" PREUSED_HEDERA_NET="testnet" -JWT_PRIVATE_KEY="..." MQ_ADDRESS="localhost" DB_HOST="localhost" MESSAGE_LANG="en-US" diff --git a/policy-service/configs/.env.policy.template b/policy-service/configs/.env.policy.template index 96124702cb..639bda6512 100644 --- a/policy-service/configs/.env.policy.template +++ b/policy-service/configs/.env.policy.template @@ -9,7 +9,6 @@ VAULT_APPROLE_SECRET_ID= # Ecosystem Defined Variables HEDERA_NET="" PREUSED_HEDERA_NET="" -JWT_PRIVATE_KEY="..." MQ_ADDRESS="" DB_HOST="" MESSAGE_LANG="en-US" diff --git a/queue-service/Dockerfile b/queue-service/Dockerfile index 7f58c8b6e2..62d3cb6666 100644 --- a/queue-service/Dockerfile +++ b/queue-service/Dockerfile @@ -1,6 +1,6 @@ # syntax=docker/dockerfile:1 # Stage 0: Use node image for base image for all stages -ARG NODE_VERSION=20.11.1-alpine +ARG NODE_VERSION=20.16-alpine FROM node:${NODE_VERSION} as base WORKDIR /usr/local/app # Define an argument `YARN_CACHE_FOLDER` for the Yarn cache directory @@ -10,9 +10,9 @@ ARG YARN_CACHE_FOLDER=/root/.yarn FROM base as interfaces COPY --link interfaces/package.json interfaces/tsconfig*.json yarn.lock ./ COPY --link interfaces/src src/ -# Here and after. Leverage a cache mount to /root/.yarn to speed up subsequent builds -RUN --mount=type=cache,target=/root/.yarn \ - yarn install --frozen-lockfile && yarn pack +# Here and after. Leverage a cache mount to `YARN_CACHE_FOLDER` to speed up subsequent builds +RUN --mount=type=cache,target=${YARN_CACHE_FOLDER} \ + yarn install --immutable && yarn pack # Stage 2: Build common module FROM base as common @@ -20,7 +20,7 @@ COPY --link --from=interfaces /usr/local/app/guardian-interfaces-*.tgz /tmp/inte COPY --link common/package.json common/tsconfig*.json yarn.lock ./ COPY --link common/src src/ RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/interfaces']='file:/tmp/interfaces.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" -RUN --mount=type=cache,target=/root/.yarn \ +RUN --mount=type=cache,target=${YARN_CACHE_FOLDER} \ yarn install && yarn pack # Stage 3: Installing production dependecies @@ -30,7 +30,7 @@ COPY --link --from=common /usr/local/app/guardian-common-*.tgz /tmp/common.tgz COPY --link queue-service/package.json queue-service/tsconfig*.json yarn.lock ./ RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/interfaces']='file:/tmp/interfaces.tgz'; input.dependencies['@guardian/common']='file:/tmp/common.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" RUN apk add --no-cache git -RUN --mount=type=cache,target=/root/.yarn,sharing=private \ +RUN --mount=type=cache,target=${YARN_CACHE_FOLDER},sharing=private \ yarn install --prod # Stage 4: Build service @@ -38,10 +38,10 @@ FROM base as build COPY --link --from=interfaces /usr/local/app/guardian-interfaces-*.tgz /tmp/interfaces.tgz COPY --link --from=common /usr/local/app/guardian-common-*.tgz /tmp/common.tgz COPY --link --from=deps /usr/local/app/package.json /usr/local/app/tsconfig*.json /usr/local/app/yarn.lock ./ -COPY --link queue-service/src src/ RUN apk add --no-cache git -RUN --mount=type=cache,target=/root/.yarn \ - yarn install --frozen-lockfile && yarn run build:prod +COPY --link queue-service/src src/ +RUN --mount=type=cache,target=${YARN_CACHE_FOLDER} \ + yarn install --immutable && yarn run build:prod # Stage 5: Create the final image FROM base as image diff --git a/topic-viewer/Dockerfile b/topic-viewer/Dockerfile index 19b30ed1d4..811db0eb36 100644 --- a/topic-viewer/Dockerfile +++ b/topic-viewer/Dockerfile @@ -1,6 +1,6 @@ # syntax=docker/dockerfile:1 # Stage 0: Use node image for base image for all stages -ARG NODE_VERSION=20.11.1-alpine +ARG NODE_VERSION=20.16-alpine FROM node:${NODE_VERSION} as base WORKDIR /usr/local/app # Define an argument `YARN_CACHE_FOLDER` for the Yarn cache directory @@ -9,16 +9,16 @@ ARG YARN_CACHE_FOLDER=/root/.yarn # Stage 1: Installing production dependecies FROM base as deps COPY --link topic-viewer/package.json topic-viewer/tsconfig*.json yarn.lock ./ -# Here and after. Leverage a cache mount to /root/.yarn to speed up subsequent builds -RUN --mount=type=cache,target=/root/.yarn,sharing=private \ - yarn install --prod +# Here and after. Leverage a cache mount to `YARN_CACHE_FOLDER` to speed up subsequent builds +RUN --mount=type=cache,target=${YARN_CACHE_FOLDER},sharing=private \ + yarn install --immutable --prod # Stage 2: Build service FROM base as build COPY --link --from=deps /usr/local/app/package.json /usr/local/app/tsconfig*.json /usr/local/app/yarn.lock ./ COPY --link topic-viewer/src src/ -RUN --mount=type=cache,target=/root/.yarn \ - yarn install --frozen-lockfile && yarn run build:prod +RUN --mount=type=cache,target=${YARN_CACHE_FOLDER} \ + yarn install --immutable && yarn run build:prod # Stage 3: Create the final image FROM base as image diff --git a/tree-viewer/Dockerfile b/tree-viewer/Dockerfile index e57e3776c0..01a8fffbfd 100644 --- a/tree-viewer/Dockerfile +++ b/tree-viewer/Dockerfile @@ -1,6 +1,6 @@ # syntax=docker/dockerfile:1 # Stage 0: Use node image for base image for all stages -ARG NODE_VERSION=20.11.1-alpine +ARG NODE_VERSION=20.16-alpine FROM node:${NODE_VERSION} as base WORKDIR /usr/local/app # Define an argument `YARN_CACHE_FOLDER` for the Yarn cache directory @@ -9,16 +9,16 @@ ARG YARN_CACHE_FOLDER=/root/.yarn # Stage 1: Installing production dependecies FROM base as deps COPY --link tree-viewer/package.json tree-viewer/tsconfig*.json yarn.lock ./ -# Here and after. Leverage a cache mount to /root/.yarn to speed up subsequent builds -RUN --mount=type=cache,target=/root/.yarn,sharing=private \ - yarn install --prod +# Here and after. Leverage a cache mount to `YARN_CACHE_FOLDER` to speed up subsequent builds +RUN --mount=type=cache,target=${YARN_CACHE_FOLDER},sharing=private \ + yarn install --immutable --prod # Stage 2: Build service FROM base as build COPY --link --from=deps /usr/local/app/package.json /usr/local/app/tsconfig*.json /usr/local/app/yarn.lock ./ COPY --link tree-viewer/src src/ -RUN --mount=type=cache,target=/root/.yarn \ - yarn install --frozen-lockfile && yarn run build:prod +RUN --mount=type=cache,target=${YARN_CACHE_FOLDER} \ + yarn install --immutable && yarn run build:prod # Stage 3: Create the final image FROM base as image diff --git a/web-proxy/Dockerfile b/web-proxy/Dockerfile index 14208d1e99..16c3aef90f 100644 --- a/web-proxy/Dockerfile +++ b/web-proxy/Dockerfile @@ -1,6 +1,6 @@ # syntax=docker/dockerfile:1 # Stage 0: Use node image for base image for all stages -ARG NODE_VERSION=20.11.1-alpine +ARG NODE_VERSION=20.16-alpine FROM node:${NODE_VERSION} as base WORKDIR /usr/local/app # Define an argument `YARN_CACHE_FOLDER` for the Yarn cache directory @@ -10,9 +10,9 @@ ARG YARN_CACHE_FOLDER=/root/.yarn FROM base as interfaces COPY --link interfaces/package.json interfaces/tsconfig*.json yarn.lock ./ COPY --link interfaces/src src/ -# Leverage a cache mount to /root/.yarn to speed up subsequent builds -RUN --mount=type=cache,target=/root/.yarn \ - yarn install --frozen-lockfile && yarn pack +# Leverage a cache mount to `YARN_CACHE_FOLDER` to speed up subsequent builds +RUN --mount=type=cache,target=${YARN_CACHE_FOLDER} \ + yarn install --immutable && yarn pack # Stage 2: Build frontend FROM base as build @@ -22,7 +22,7 @@ COPY --link ./frontend/. ./ RUN npm install interfaces.tgz && npm run build # Stage 3: Create the final image -FROM nginxinc/nginx-unprivileged:1.25.4-alpine as image +FROM nginxinc/nginx-unprivileged:1.27-alpine as image # Copy config and built application from the build stage into the image COPY --link ./web-proxy/configs/default.conf /etc/nginx/conf.d/default.conf diff --git a/web-proxy/Dockerfile.ci b/web-proxy/Dockerfile.ci index 91c38327e7..5fa1b89c8c 100644 --- a/web-proxy/Dockerfile.ci +++ b/web-proxy/Dockerfile.ci @@ -1,6 +1,6 @@ # syntax=docker/dockerfile:1 # Stage 0: Use node image for base image for all stages -ARG NODE_VERSION=20.11.1-alpine +ARG NODE_VERSION=20.16-alpine FROM node:${NODE_VERSION} as base WORKDIR /usr/local/app # Define an argument `YARN_CACHE_FOLDER` for the Yarn cache directory @@ -10,9 +10,9 @@ ARG YARN_CACHE_FOLDER=/root/.yarn FROM base as interfaces COPY --link interfaces/package.json interfaces/tsconfig*.json yarn.lock ./ COPY --link interfaces/src src/ -# Leverage a cache mount to /root/.yarn to speed up subsequent builds -RUN --mount=type=cache,target=/root/.yarn \ - yarn install --frozen-lockfile && yarn pack +# Leverage a cache mount to `YARN_CACHE_FOLDER` to speed up subsequent builds +RUN --mount=type=cache,target=${YARN_CACHE_FOLDER} \ + yarn install --immutable && yarn pack # Stage 2: Build frontend FROM base as build @@ -22,7 +22,7 @@ COPY --link ./frontend/. ./ RUN npm install interfaces.tgz && npm run build:prod # Stage 3: Create the final image -FROM nginxinc/nginx-unprivileged:1.25.4-alpine as image +FROM nginxinc/nginx-unprivileged:1.27-alpine as image # Copy config and built application from the build stage into the image COPY --link ./web-proxy/configs/image.conf /etc/nginx/templates/default.conf.template diff --git a/web-proxy/Dockerfile.demo b/web-proxy/Dockerfile.demo index d8e8669664..bfbe5235b2 100644 --- a/web-proxy/Dockerfile.demo +++ b/web-proxy/Dockerfile.demo @@ -1,6 +1,6 @@ # syntax=docker/dockerfile:1 # Stage 0: Use node image for base image for all stages -ARG NODE_VERSION=20.11.1-alpine +ARG NODE_VERSION=20.16-alpine FROM node:${NODE_VERSION} as base WORKDIR /usr/local/app # Define an argument `YARN_CACHE_FOLDER` for the Yarn cache directory @@ -10,9 +10,9 @@ ARG YARN_CACHE_FOLDER=/root/.yarn FROM base as interfaces COPY --link interfaces/package.json interfaces/tsconfig*.json yarn.lock ./ COPY --link interfaces/src src/ -# Leverage a cache mount to /root/.yarn to speed up subsequent builds -RUN --mount=type=cache,target=/root/.yarn \ - yarn install --frozen-lockfile && yarn pack +# Leverage a cache mount to `YARN_CACHE_FOLDER` to speed up subsequent builds +RUN --mount=type=cache,target=${YARN_CACHE_FOLDER} \ + yarn install --immutable && yarn pack # Stage 2: Build frontend FROM base as build @@ -22,7 +22,7 @@ COPY --link ./frontend/. ./ RUN npm install interfaces.tgz && npm run build:demo # Stage 3: Create the final image -FROM nginxinc/nginx-unprivileged:1.25.4-alpine as image +FROM nginxinc/nginx-unprivileged:1.27-alpine as image # Copy config and built application from the build stage into the image COPY --link ./web-proxy/configs/demo.conf /etc/nginx/templates/default.conf.template diff --git a/worker-service/Dockerfile b/worker-service/Dockerfile index f8550205bf..b7be13ba36 100644 --- a/worker-service/Dockerfile +++ b/worker-service/Dockerfile @@ -1,6 +1,6 @@ # syntax=docker/dockerfile:1 # Stage 0: Use node image for base image for all stages -ARG NODE_VERSION=20.11.1-alpine +ARG NODE_VERSION=20.16-alpine FROM node:${NODE_VERSION} as base WORKDIR /usr/local/app # Define an argument `YARN_CACHE_FOLDER` for the Yarn cache directory @@ -10,9 +10,9 @@ ARG YARN_CACHE_FOLDER=/root/.yarn FROM base as interfaces COPY --link interfaces/package.json interfaces/tsconfig*.json yarn.lock ./ COPY --link interfaces/src src/ -# Here and after. Leverage a cache mount to /root/.yarn to speed up subsequent builds -RUN --mount=type=cache,target=/root/.yarn \ - yarn install --frozen-lockfile && yarn pack +# Here and after. Leverage a cache mount to `YARN_CACHE_FOLDER` to speed up subsequent builds +RUN --mount=type=cache,target=${YARN_CACHE_FOLDER} \ + yarn install --immutable && yarn pack # Stage 2: Build common module FROM base as common @@ -20,7 +20,7 @@ COPY --link --from=interfaces /usr/local/app/guardian-interfaces-*.tgz /tmp/inte COPY --link common/package.json common/tsconfig*.json yarn.lock ./ COPY --link common/src src/ RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/interfaces']='file:/tmp/interfaces.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" -RUN --mount=type=cache,target=/root/.yarn \ +RUN --mount=type=cache,target=${YARN_CACHE_FOLDER} \ yarn install && yarn pack # Stage 3: Installing production dependecies @@ -30,7 +30,7 @@ COPY --link --from=common /usr/local/app/guardian-common-*.tgz /tmp/common.tgz COPY --link worker-service/package.json worker-service/tsconfig*.json yarn.lock ./ RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/interfaces']='file:/tmp/interfaces.tgz'; input.dependencies['@guardian/common']='file:/tmp/common.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));" RUN apk add --no-cache git -RUN --mount=type=cache,target=/root/.yarn,sharing=private \ +RUN --mount=type=cache,target=${YARN_CACHE_FOLDER},sharing=private \ yarn install --prod # Stage 4: Build service @@ -38,10 +38,10 @@ FROM base as build COPY --link --from=interfaces /usr/local/app/guardian-interfaces-*.tgz /tmp/interfaces.tgz COPY --link --from=common /usr/local/app/guardian-common-*.tgz /tmp/common.tgz COPY --link --from=deps /usr/local/app/package.json /usr/local/app/tsconfig*.json /usr/local/app/yarn.lock ./ -COPY --link worker-service/src src/ RUN apk add --no-cache git -RUN --mount=type=cache,target=/root/.yarn \ - yarn install --frozen-lockfile && yarn run build:prod +COPY --link worker-service/src src/ +RUN --mount=type=cache,target=${YARN_CACHE_FOLDER} \ + yarn install --immutable && yarn run build:prod # Stage 5: Create the final image FROM base as image diff --git a/worker-service/configs/.env.worker b/worker-service/configs/.env.worker index ef8ed48fff..486a3e9623 100644 --- a/worker-service/configs/.env.worker +++ b/worker-service/configs/.env.worker @@ -8,7 +8,6 @@ VAULT_APPROLE_SECRET_ID= # SERVICE_CHANNEL="worker.1" # assigned at orchestrator level HEDERA_NET="testnet" PREUSED_HEDERA_NET="testnet" -JWT_PRIVATE_KEY="..." MQ_ADDRESS="localhost" MIN_PRIORITY="0" MAX_PRIORITY="20" @@ -65,4 +64,4 @@ SEQ_API_KEY="" #MONGO_INIT MIN_POOL_SIZE="1" MAX_POOL_SIZE="5" -MAX_IDLE_TIME_MS="30000" \ No newline at end of file +MAX_IDLE_TIME_MS="30000" diff --git a/worker-service/configs/.env.worker.develop b/worker-service/configs/.env.worker.develop index bde04bed92..8b4d961286 100644 --- a/worker-service/configs/.env.worker.develop +++ b/worker-service/configs/.env.worker.develop @@ -8,7 +8,6 @@ VAULT_APPROLE_SECRET_ID= # SERVICE_CHANNEL="worker.1" # assigned at orchestrator level HEDERA_NET="testnet" PREUSED_HEDERA_NET="testnet" -JWT_PRIVATE_KEY="..." MQ_ADDRESS="localhost" MIN_PRIORITY="0" MAX_PRIORITY="20" @@ -65,4 +64,4 @@ SEQ_API_KEY="" #MONGO_INIT MIN_POOL_SIZE="1" MAX_POOL_SIZE="5" -MAX_IDLE_TIME_MS="30000" \ No newline at end of file +MAX_IDLE_TIME_MS="30000" diff --git a/worker-service/configs/.env.worker.template b/worker-service/configs/.env.worker.template index 500feb3371..a9f04c172f 100644 --- a/worker-service/configs/.env.worker.template +++ b/worker-service/configs/.env.worker.template @@ -8,7 +8,6 @@ VAULT_APPROLE_SECRET_ID= # SERVICE_CHANNEL="worker.1" # assigned at orchestrator level HEDERA_NET="" PREUSED_HEDERA_NET="" -JWT_PRIVATE_KEY="..." MQ_ADDRESS="" MIN_PRIORITY="0" MAX_PRIORITY="20" @@ -64,4 +63,4 @@ SEQ_API_KEY="" #MONGO_INIT MIN_POOL_SIZE="" MAX_POOL_SIZE="" -MAX_IDLE_TIME_MS="" \ No newline at end of file +MAX_IDLE_TIME_MS=""